Javier's Blog

Mostly computers and other tech stuff,...

Friday, January 08, 2010

OS X Apache PHP

I was pleasantly surprised to find out how easy it is to "use" Apache + PHP on OS X. That's right, no need to install it, it comes preinstalled. Just edit /private/etc/apache2/httpd.conf and uncomment the php_module line ('LoadModule php5_module'). Then go to System Preferences > Sharing, and enable Web Sharing.

Testing this is as easy as:

cat > ~/Sites/test.php
<? phpinfo(); ?>

Then go to http://localhost/~username/test.php :)


Post a Comment

<< Home