Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to do PHP development on OS X

I just got a Mac with OS X (10.6.8). What options do I have to do serious PHP developement, including a debugger?

I don't ask about what IDE to use. I'm not sure what is the best way to get PHP including XDebug (or any other professional debugger) working. I heard that the Mac comes with Apache and PHP preinstalled. Where can I find any documentation about this. Should I just add MySql and work with this? Or should I go for MAMP or XAMPP. What would be the benefit of this installs over the built in?

I found a lot of descriptions about how to compile XDebug from scratch. Non of them worked for me. Isn't there an easier way of getting a debugger working for OS X?

I'm also ready to upgrade the Mac to the latest OS X, if this is of any help.

like image 349
BetaRide Avatar asked Dec 01 '22 23:12

BetaRide


2 Answers

In the age of virtualization

  • vagrant box full of ubuntu and zend CE server
  • zend studio for ide and zend debugger works out of the box
  • you can config it to use x-debug just apt-get it

this way you'll keep your os-x clean and have all the necessary stuff inside a portable/deployable virtual machine that runs on background or can be launched from any machine you might be using today or tomorrow

like image 100
Anton S Avatar answered Dec 13 '22 12:12

Anton S


After a lot more googling and try and error I found a very nice and easy to install solution which works great for me:

  1. Installed MacGDBp.
  2. Installed MAMP.
  3. Opened the php.ini at /Applications/MAMP/bin/php/php5.3.6/conf/php.ini and uncommented the only line containing the xdebug.so file.
  4. Added this lines at the end of php.ini

    xdebug.remote_enable=1
    xdebug.remote_host=localhost 
    xdebug.remote_port=9000
    xdebug.remote_autostart=1
    
  5. After restarting apache MacGDBp stoped at the first PHP line.

  6. Done!
like image 40
BetaRide Avatar answered Dec 13 '22 12:12

BetaRide