Wednesday, October 28, 2009

Previewing PHP in Aptana Studio (MAC OS X)


For those who are not familiar who Aptana Studio or MAMP: Apatana studio is a free development environment for AJAX. Aptana also has plugins for PHP, Ruby on Rails and Adobe AIR. MAMP stands for: Macintosh, Apache, Mysql and PHP. MAMP installs a local server environment in a matter of seconds on your Mac OS X computer.
Now working with Aptana on my php projects is great but whenever I need to preview or test php code I have had to upload the new files to the server and test it through the web browser. Wrong, Wrong Wrong. Using MAMP, you can setup a local Apache, PHP, MySQL installation and preview your code inside of Aptana without uploading to a server or opening a web browser.
Here is what you need:
Apatana Studio with the PHP plugin installed
MAMP
Firefox or Safari
I am not going to go into the installation Aptana Studio, MAMP or Firefox, right now. They are pretty straight forward. First thing you need to know is the DocumentRoot of your MAMP installation. By default it is the htdoc folder under the MAMP folder. This is where you will create your PHP project. Startup MAMP
Open Aptana and create a new project
Window->Preferences->Aptana->Editors->HTML->Preview
Select User Server in the drop down select add new server
The add new server window will pop up Select Apache as the server type
Click Ok
A preferences window will open, for name give a unique name, Description a short description (this is optional), Apache is looking for the path the the httpd script file. Mine is in the Application/MAMP/bin/apache2/bin folder
Host should be localhost, port will be the port number MAMP is running on mine is 8888, Path to log $MAMP/logs/apache_error.log
Click ok
If you Aptana project is in a folder inside the htdoc folder check Append project name. For this to work properly the name of the project has to match the name of the folder.
http://www.aptana.com/studio
http://www.mamp.info/en/index.php','For those who are not familiar who Aptana Studio or MAMP: Apatana studio is a free development environment for AJAX. Aptana also has plugins for PHP, Ruby on Rails and Adobe AIR. MAMP stands for: Macintosh, Apache, Mysql and PHP. MAMP installs a local server environment in a matter of seconds on your Mac OS X computer.
Now working with Aptana on my php projects is great but whenever I need to preview or test php code I have had to upload the new files to the server and test it through the web browser. Wrong, Wrong Wrong. Using MAMP, you can setup a local Apache, PHP, MySQL installation and preview your code inside of Aptana without uploading to a server or opening a web browser.

No comments:

Post a Comment