On configuring Xampp on eclipse PDT , we can make our PHP development easier.
Here are the steps to be followed to configure Xampp on eclipse PDT.
step1. Download Xampp
Download xampp from Apache Friends Web site
For Installation instruction click the below link
step2. Start the XAMPP Server by typing the command.
cluster3-desktop lampp # /opt/lampp/lampp start
Open the browser and type in the url(http://localhost). You can see the
XAMPP server page up.
step3. Download Eclipse PDT
Download eclipse PDT from eclipse website
http://www.eclipse.org/pdt/downloads
step4. Extract the downloaded file
tar -xzvf eclipse-php-helios-linux-gtk-x86_64.tar.gz
The ‘eclipse’ folder will be created in your current working directory
step5. Create a WorkSpace directory for the eclipse in the root directory
of Xampp
When it asks you to select a Workspace browse to
/opt/lampp/htdocs
where you installed XAMPP. The reason is that when you come to run
your PHP program Eclipse will generate a URL and expect the web
server to find the file and serve it to the browser.
cluster3-desktop htdocs # mkdir /opt/lampp/htdocs/Demo
This will
create a "Demo" folder in htdocs folder of xampp server.
step6. Give full permission to the directory
cluster3-desktop htdocs # sudo chmod -R 777 /opt/lampp
/htdocs/Demo
step7. Start Eclipse and select a Workspace as /opt/lampp/htdocs/Demo
step8. Now Eclipse will open.
Create a ‘New PHP Project’ and Create a New File in that with any name
(For Example ‘demo.php’)
step9. Select your project directory in eclipse and then click on
'Window-->Preferences'
step10. Navigate to the ‘PHP’ Tab and expand it on the left hand side of the ‘Preference’ window.
step11. Click on ‘PHP Executable s’. Click on ‘Search’ and locate where the /opt/lampp is
installed and then click ‘OK’.
step12. Run demo.php
Right click demo.php and select Run As -> PHP Web Page