Skip to content

Instantly share code, notes, and snippets.

@eegrok
Created December 8, 2011 22:06
Show Gist options
  • Select an option

  • Save eegrok/1448872 to your computer and use it in GitHub Desktop.

Select an option

Save eegrok/1448872 to your computer and use it in GitHub Desktop.
set up php / apache on osx lion
#create file containing something like below -- in /etc/apache2/sites/localweb.conf
# (you may need to create the /etc/apache2/sites directory)
<VirtualHost 127.0.0.1:80>
ServerName www.localweb.com
ServerAlias *.localweb.com
DocumentRoot "/Users/kem/src/localweb"
<Directory "/Users/kem/src/localweb">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# then go into system preferences -> sharing, turn on web sharing
#
# from: http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/
edit /etc/apache2/httpd.conf, Find #LoadModule php5_module libexec/apache2/libphp5.so and remove the leading #
cd /etc
sudo cp php.ini.default php.ini
sudo chmod ug+w php.ini
sudo chgrp admin php.ini
vim php.ini (assuming your user is a member of the admin group) and change settings appropriately. Change:
error_reporting = E_ALL | E_STRICT
display_errors = On
html_errors = On
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626"
Also, change all instances of /var/mysql/mysql.sock to /tmp/mysql.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment