
- #How to run php on localhost eclipse on mac how to#
- #How to run php on localhost eclipse on mac mac osx#
Now press control+w to search in the Nano editor. Many php applications rely on htaccess for URL routing.Īgain open the nf file in your terminal. Set the permission of the user configuration file by typing the following in your Terminal $ sudo chmod 644 /etc/apache2/users/nf Options FollowSymLinks Indexes MultiViews Replace with your username $ sudo nano /etc/apache2/users/nfĪdd the following lines to the file.*Important: the directory path in the first line is case sensitive.

Using nano will open the file if it already exists or create it if it doesn't. To host files in your Sites/ directory you will need to create a user file for your osx user (use the user short name, if unsure of what it is go /Users directory and you will see the short names of all the users)Ĭreate the file by typing the following in your Terminal. Remove the # in the front of the line commenting it out. Now that the file is open, find the line where LoadModule php5_module libexec/apache2/libphp5.so is commented out. Inside your Terminal window type the following command to open the nf file in the editor nano $ sudo nano /etc/apache2/nf You will need to edit your Apache Httpd configuration file to enable PHP.

To stop the Apache web server type the following command in your Terminal: $ sudo apachectl stop Congratulations you now have a running Apache server. If you open your internet browser and navigation to You will see the following. To start the Apache server type the following command in your Terminal window $ sudo apachectl start Open your Terminal (found in your Utilities folder which is inside your Applications folder) If you upgraded from a previous version of OS X your hosting environment will be broken.Īpache is still installed on your Mac by default.Īpache comes preinstalled on Apple OS X 10.8 Mountain Lion What you need to know since the release of Mountain LionĪpple changed its hosting environment for OS X 10.8 +Īpple dropped the GUI option to turn on web sharing, but it's still possible to do manually.
#How to run php on localhost eclipse on mac mac osx#
Part 1 set up an Apache server to run PHP on a mac OSX 10.8+ with Mountain Lion or later operation system
#How to run php on localhost eclipse on mac how to#
This tutorial will show you how to set up an Apache server to run PHP on a mac OSX 10.8+ with Mountain Lion or later operation system.
