Created
February 11, 2013 15:09
-
-
Save jjulian/4754983 to your computer and use it in GitHub Desktop.
Run PHP on a Mac using Apache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ edit httpd.conf to match your local filesystem | |
$ mkdir tmp logs public php | |
$ mv public.php public/ | |
$ cp <your php.ini> to php/php.ini | |
$ apachectl -f /Users/jjulian/runphp/httpd.conf -t | |
$ apachectl -f /Users/jjulian/runphp/httpd.conf -k start | |
$ curl -D - http://localhost:8888 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServerRoot /Users/jjulian/runphp | |
PidFile tmp/httpd.pid | |
LockFile tmp/accept.lock | |
User jjulian | |
ServerName localhost | |
Listen 8888 | |
<IfModule mpm_prefork_module> | |
StartServers 5 | |
MinSpareServers 5 | |
MaxSpareServers 5 | |
MaxClients 10 | |
MaxRequestsPerChild 0 | |
</IfModule> | |
LoadModule authz_host_module /usr/libexec/apache2/mod_authz_host.so | |
LoadModule log_config_module /usr/libexec/apache2/mod_log_config.so | |
LoadModule mime_module /usr/libexec/apache2/mod_mime.so | |
LoadModule autoindex_module /usr/libexec/apache2/mod_autoindex.so | |
LoadModule negotiation_module /usr/libexec/apache2/mod_negotiation.so | |
LoadModule dir_module /usr/libexec/apache2/mod_dir.so | |
LoadModule rewrite_module /usr/libexec/apache2/mod_rewrite.so | |
LoadModule php5_module /usr/libexec/apache2/libphp5.so | |
<IfModule mod_php5.c> | |
PHPIniDir /Users/jjulian/runphp/php | |
<IfModule mime_module> | |
AddType application/x-httpd-php .php | |
</IfModule> | |
<IfModule dir_module> | |
DirectoryIndex index.html index.php | |
</IfModule> | |
</IfModule> | |
DocumentRoot "/Users/jjulian/runphp/public" | |
<Directory /Users/jjulian/runphp/public> | |
AllowOverride None | |
Order allow,deny | |
Allow from 127.0.0.1, localhost | |
</Directory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo 1 + 2 ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment