Enable php on mac

link

  1. Navigate to /etc/apache2
  2. Do a search for “php”. You should see the following line:#LoadModule php5_module libexec/apache2/libphp5.soRemove the “#”
  3. Save the file. You may need to authenticate upon saving.
  4. run sudo apachectl restart to restart apache
  5. visit localhost you will see It works!
  6. /etc/apache2/httpd.confSearch for “virtual” in your text editor. You should see the following lines:
1
2
#Virtual hosts
#Include /private/etc/apache2/ extra/httpd-

Uncomment the second line that starts with “#Include” by removing the “#”. We now need to modify httpd-vhosts.conf file to add our virtual hosts.

  1. open/etc/apache2/extra/httpd-vhosts.conf
1
2
DocumentRoot "/Users/username/Sites/Website"
ServerName yourwebsitename

Another tutorial

  • Install : XAMPP Mac OS X 1.7.3 download
  • sudo su
  • /Applications/XAMPP/xamppfiles/xampp start

if you see

1
2
XAMPP: Starting ProFTPD.../Applications/XAMPP/xamppfiles/xampp: line 184: /Applications/XAMPP/xamppfiles//var/proftpd/start.err: No such file or directory fail.
Contents of "/Applications/XAMPP/xamppfiles//var/proftpd/start.err": cat: /Applications/XAMPP/xamppfiles//var/proftpd/start.err: No such file or directory

do these commands

1
2
3
4
5
6
7
`sudo mkdir /Applications/XAMPP/xamppfiles/var/proftpd/`
`touch /Applications/XAMPP/xamppfiles/var/proftpd/start.err`
`sudo /Applications/XAMPP/xamppfiles/xampp fix_rights`
then redo the `/Applications/XAMPP/xamppfiles/xampp start` cmd