Skip to content

Instantly share code, notes, and snippets.

@wbyoung
Created October 13, 2014 18:49
Show Gist options
  • Save wbyoung/ddfa92a95c6111f9adb3 to your computer and use it in GitHub Desktop.
Save wbyoung/ddfa92a95c6111f9adb3 to your computer and use it in GitHub Desktop.
Run Apache in current directory with PHP enabled.
DocumentRoot "."
ServerName localhost
ErrorLog "apache_error_log"
LogLevel warn
LoadModule authz_host_module /usr/libexec/apache2/mod_authz_host.so
LoadModule auth_basic_module /usr/libexec/apache2/mod_auth_basic.so
LoadModule auth_digest_module /usr/libexec/apache2/mod_auth_digest.so
LoadModule deflate_module /usr/libexec/apache2/mod_deflate.so
LoadModule log_config_module /usr/libexec/apache2/mod_log_config.so
LoadModule mime_module /usr/libexec/apache2/mod_mime.so
LoadModule dir_module /usr/libexec/apache2/mod_dir.so
LoadModule alias_module /usr/libexec/apache2/mod_alias.so
LoadModule rewrite_module /usr/libexec/apache2/mod_rewrite.so
LoadModule php5_module /usr/libexec/apache2/libphp5.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
sudo httpd -k start -C "User `whoami`" -C "Listen 8000" -X -d . -f httpd.conf
# `killall -9 httpd` if required to stop the server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment