- #MAC OS X TERMINAL START APACHE HOW TO#
- #MAC OS X TERMINAL START APACHE MAC OS#
- #MAC OS X TERMINAL START APACHE INSTALL#
- #MAC OS X TERMINAL START APACHE CODE#
- #MAC OS X TERMINAL START APACHE DOWNLOAD#
Let’s change the DocumentRoot to that folder:ġ. But all my existing web projects reside in /Users/username/Sites. The default Apache DocumentRoot, where we should put our website documents, is located at /Library/WebServer/Documents. You can type the following command in Terminal to start Apache server.Īccess in the Browser to verify that the Apache server is working. Sudo cp /private/etc/ /private/etc/php.ini This command copies the and rename it to php.ini. Go to Terminal and run the following command line. PHP configurations such as Increasing Memory Limit, File Upload Allowance, and Set the Maximum Upload File Size are done through php.ini file, which also is disabled by default. See the following screenshot for more detail: LoadModule php5_module libexec/apache2/libphp5.so Uncomment the following line by removing the hash sign #. Type the following command to open nf in Sublime Text.Ģ. We have to enable it in order to use and execute PHP scripts in Apache server:ġ. The PHP module, however, is disabled by default. You can check the PHP version that is installed in Terminal with the following command command: In addition, this also ensures that subl is registered and working.Īs mentioned, PHP has already been installed in OS X. It will return the Usage and the list of Arguments that can be used with subl, as you can see from the screenshot below. Ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl Create a symlink of Sublime Text subl binary in the ~/bin folder with this command: Recommended Reading : Beginner’s Guide To WordPress Multisite With MAMP Step 1: Enable Sublime Text Command Lineįirst, since I’m using Sublime Text, I would like to enable the Sublime Text command line so I will be able to open files and folders through Terminal, and edit them within Sublime Text.
#MAC OS X TERMINAL START APACHE HOW TO#
In this post, we will show you how to configure PHP, Apache, and MySQL in OS X without MAMP. You simply put the application in the Application folder, launch the app, and hit the Start Server button and off you go.īut, OS X has actually been shipped with PHP, and Apache built in so why not use them to develop and run websites locally instead of using third party apps like MAMP or the likes? That way, we will occupy less space for apps, and we will also learn a few things in the process of getting them to work. Using MAMP is probably the easiest way to have PHP, Apache, and MySQL up and running in OS X.
#MAC OS X TERMINAL START APACHE INSTALL#
To install the php cli, add the php binary path to the. To start, stop and restart apache server. Ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents Ln -sfv /usr/local/opt/php56/*.plist ~/Library/LaunchAgents To have launchd start homebrew/php/php56 at login: Ln -sfv /usr/local/opt/httpd24/*.plist ~/Library/LaunchAgents To have launchd start homebrew/apache/httpd24 at login: Visit localhost in your browser and you should see a php info page. Start Apache server from the Terminal window.ġ3.
#MAC OS X TERMINAL START APACHE CODE#
Create an index.php file in /Users/yourname/sites with the code below that prints the phpinfo.ġ2. yourname is your user name that shows on the Terminal window.ġ1. Find the lines with DocumentRoot and Directory, and change them to these. LoadModule deflate_module libexec/mod_deflate.soġ0. LoadModule expires_module libexec/mod_expires.so LoadModule rewrite_module libexec/mod_rewrite.so Find the following lines in the config file and uncomment them by removing the # Find the line with DirectoryIndex and change it to the followingĩ. Find the line that has AddType and add the following line.Ĩ. LoadModule php5_module /usr/local/Cellar/php56/5.6.12/libexec/apache2/libphp5.soħ. The path for libphp5.so might be different depending on the php version. Load php56 module in the config file, add this line next to the last LoadModule in the config file.
By default, Apache 2.4 listens to port 8080 instead of 80, find the line with Listen 8080 and change it to the following.Ħ. Open the apache 2.4 config file, and proceed to the following steps. Install pcre, libtool, mysql, php56 and appache2.4 through brew package manager.īrew install pcre libtool mysql php56 httpd24Ĥ. If you don’t have the home brew package manager installed yet, open up the terminal and type this command to get brew.ģ.
#MAC OS X TERMINAL START APACHE DOWNLOAD#
If you don’t have Xcode installed yet on your Mac, download and install it from the Apple App Store.Ģ.
#MAC OS X TERMINAL START APACHE MAC OS#
Before install your own apache server, make sure the apache server that came with Mac OS is shut down by issuing this command in the Termainal windowġ.