How to set up Apache, PHP & MySQL on Mac OS X 10.11 El Capitan & OS X 10.10 Yosemite

sudo nano -w /etc/apache2/httpd.conf
#LoadModule userdir_module libexec/apache2/
#LoadModule rewrite_module libexec/apache2/
#LoadModule php5_module libexec/apache2/
LoadModule authz_host_module libexec/apache2/
LoadModule authz_core_module libexec/apache2/
DirectoryIndex index.html
DirectoryIndex index.html index.php
#Include /private/etc/apache2/extra/httpd-userdir.conf
sudo nano -w /etc/apache2/extra/httpd-userdir.conf
#Include /private/etc/apache2/users/*.conf
ls /etc/apache2/users/*.conf
sudo nano -w /etc/apache2/users/danilo.conf
<Directory "/Users/danilo/Sites/">
Options Indexes MultiViews FollowSymLinks
Require all granted
AllowOverride All
Order allow,deny
Allow from all
sudo cp /etc/php.ini.default /etc/php.ini
sudo chmod 644 /etc/php.ini
sudo nano -w /etc/php.ini
error_reporting = 
error_reporting = E_ALL | E_STRICT
display_errors = Off
display_errors = On
;date.timezone =
date.timezone = America/Los_Angeles
sudo nano -w /etc/php.ini
mysql.default_socket = 
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket =
mysqli.default_socket = /tmp/mysql.sock
nano -w ~/.bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
source ~/.bash_profile
sudo apachectl restart
<?php phpinfo(); ?>



Entrepreneur, Technologist & Product Guy

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store