(1) Follow my first two articlesblog"How to install XAMPP on Mac" and "Eclipse Configuring PHP Development Environment". Configure the PHP development environment and server.
(2) To switch the workspace, be sure to switch the workspace for developing PHP to the directory of the XAMPPserver. Otherwise, the PHP program cannot be run. As shown in the figure, the default path of XAMPP is generally as follows:
(3) Create a new PHP Project in Eclipse, and then create a new PHP File in the project. The implementation code is as follows:
<?php echo 'Hello World!';
.
(4) Then right-click on the blank space of the current file-->Run As-->PHP Web Appliction. to run the program, the effect is as follows: Of course, you can also copy the link to the browser, and you can see the same The effect.
The above has introduced the first PHP program-Hello World, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.