http://localhost
Terminal
App. Mac OS X comes by default with Perl library
. Just type below commands to check Perl and PHP Setup.2 4 6 8 10 12 14 16 18 | /usr/bin/perl bash-3.2# pwd total120 -rw-r--r--1root wheel13077Sep92014magic drwxr-xr-x14root wheel476Sep92014extra -rw-r--r--1root wheel20786Sep92014httpd.conf -rw-r--r--1root wheel20786Jun913:55httpd.conf.bak bash-3.2# vi httpd.conf |
httpd.conf
file. You may use any Text Editor
also.LoadModule php5_module libexec/apache2/libphp5.so
DocumentRoot
from httpd.conf
file. In my case it’s /Users/crunchify/Documents/Blogs/MAMP
as I’m using MAMP on my Mac./Library/WebServer/Documents/
.crunchify-php-on-mac.php
under your DocumentRoot folder.Web Server
then just create it ?2 4 6 8 | <head> </head> <?phpecho'<p>Hello World - PHP Testcase on Mac OS X by Crunchify.com...</p><br>Have a fun.. Enjoy..';?> </html> |
http://localhost/crunchify-php-on-mac.php
and you should see php file loaded successfully on browser.2 | sudo launchctl unload/System/Library/LaunchDaemons/org.apache.httpd.plist |
root
to avoid permission issues while running these commands.#
):mysql
and mysqladmin
. However there are other commands that are helpful such as mysqldump
. Instead, I updated my path to include /usr/local/mysql/bin
.mysql_secure_installation
. While this isn't necessary, it's good practice.Include
after upgrading an existing install to Mac OS X Mavericks.VirtualHost
points to /Library/WebServer/Documents
. The first VirtualHost
is important as it behaves like the default Apache configuration and used when no others match.VirtualHost
points to my dev workspace and I can access it directly from http://jason.local. For ease of development, I also configured some custom logs.VirtualHost
and edit your hosts file each time you make a new local site._www
) needs to have access to read, and sometimes write, your web directory.755
. You can change permissions with the command:~/Documents
directory. Which by default is only readable by me. So I had to change permissions for my web directory all the way up to ~/Documents
to resolve the 403 Forbidden issue.