☰ See All Chapters |
PHP Example with Eclipse
In this tutorial you will learn to create PHP example with eclipse IDE. We use XAMPP package installed on windows operating system to run PHP. Refer the previous tutorial How to Install PHP on Windows to prepare environment to run PHP.
Step 1: Install PHP Development Tools plugin
Install PHP Development Tools Plugin form eclipse marketplace. From eclipse navigate to Help then click on Eclipse Market Place. Now search for PHP. You will get the PHP Development Tools Plugin in search results. Click on Install button to install the plugin.
Step 2: Configure PHP executable
Select Windows>Preferences>PHP>Installed PHPs, then click on Add Button.
Click on Browse button and select the PHP executable php.exe from XAMPP installation. Click on Finish button and then on Apply And Close Button.
Step 3: Create PHP project
Select New>Other
Select PHP Project and Click Next
Enter the project name and click Finish
Step 4: Create PHP File
Right click on project and select New>PHP File.
Enter the name and click Finish
Enter the below code to the php file
<!DOCTYPE HTML> <html> <head> <title>PHP Example</title> </head> <body> <?php echo 'Hello World!'; ?> </body> </html> |
Step 5: Check the output
Right click on index.php, select Run As>Run on Server.
Select PHP Built-in Server and click Finish
You should see the output now as below:
All Chapters