PHP developing on a mac 0
So its now 3 month ago when i got my first mac. It was a macbook. The first moments with my macbook felt like a big step forward. I dont forget the day when the UPS van stopped at my home and brought me the package. I was excited like a young kid on chrismas.
Today i wanna show you how i develop a PHP application on a mac.
Webserver - LAMP, WAMP ehm MAMP?
For my Windows PC i use WAMP from apachefriends.org (XAMPP) and also LAMP for my lokal linux server. So i thought maybe there is a package same as xampp for my mac. First search: MAMP. First result: MAMP.info Bingo.
Generally it is possible, cause OSX based on unix, to install all the components for a mamp system separately. You can even compile your apache on your mac. But i want it easy and fast.
The installation of mamp is very easy. Just drag MAMP in your Application Folder. Start MAMP and you are ready.
MAMP brings beside the necessary components PHPMyAdmin and eAccelerator to your webserver.
Configuration - Vhost and host.ini ?
Personally i always create for a new project a virtual host ( eg. http://testprojekt.localhost or http://myblog ). Under Windows you edit the httpd.conf and then the host.ini in WINDOWS/system32/drivers…etc. But how does it work on OS X? Edit your httpd.conf in /Applications/MAMP/conf/apache add following lines -> Apache VirtualHost.
Now you need to link “project1″ to your local IP: 127.0.0.1
- Hit Apple+Space for Spotlight and search: Netinfo and start the application
- Select the category maschines
- Select localhost click on copy/duplicate. When you cant do that. You have to unlock the configuration with your password. ( I have the german version of Mac OSX so i dont know how exactly the buttons and texts are)
- Edit the name to project1
-

- Save it.
- Restart your MAMP and try in your browser http://project1
- If this dont work you have to edit the host file in /etc/host
- Open the Terminal (Apple+Space Spotlight: Terminal)
- sudo pico /etc/hosts

- add a line: 127.0.0.1 project1
- Save and Exit with Ctrl+X
- Try in your browser http://project1
The development environment
For the mac you have the following editors
- Eclipse
- Dreamweaver
- Komodo
- Zend Studio
- Textmate
- BBEdit
Im using Zend Studio on my Windows PC and at work. Zend Studio is a Java Application and so it works on OS X too. Great! The current version 5.5 is very fast and stable on my macbook with 1GB ram.
With a integrated Debugger you cant debug your php application.
Beside the File view you have a project view, SQL view and a Class view where you can browse your written classes and functions. You can document your methods ,classes, parameter and zend add these in the auto completion list with the documentation for the parameter. Overall the auto completion is very helpful and saves time!
All in all my favorite PHP IDE.
A tiny but very powerful editor for OS X. I use Textmate for HTML, CSS and Javascript. For those languages it works great and the shortcuts and auto completion are awesome! For fast PHP editing i use Textmate too. But i miss the Debugger and the Class/SQL View.
The other Editors are still on my testing list.
I hope this was helpful and maybe a bit interesting! ![]()
When you have questions, other opinions or corrections. Please make a comment!