Mac OS setup apache and php
In : system, Posted by admin on Jun.06, 2009
here is the steps to setup apache and php in your Mac OS X.
- Apache and PHP already came with your OS. You just need to enable it.
- Go to the apple icon on the menu bar. Select “System Preferences…” -> “Internet & Network” -> “Sharing”
- Enable “Web Sharing” by click on it
- You just enabled the web server. You can test it by go to: http://localhost/
- To enabled php, in a command window, edit /private/etc/apache2/httpd.conf
- remove the “#” character in front of this line: LoadModule php5_module libexec/apache2/libphp5.so
- restart the apache server by: sudo apachectl restart
- now you have php enabled.
- add a file called: /private/etc/apache2/users/your_username>.conf
- put this in the file:
- #
# Allow access to this user’s Sites directory for web clients.
#
<Directory “/Users/your_username/Sites/”>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>- remember to replace “your_username” with your username.
- restart apache: sudo apachectl restart
- put a file in /Users/your_username/Sites/x.htm
- go to the browser: http://localhost/~your_username/x.htm
- and you will see the file.
Tags : mac
Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment