To stop XAMPP simply open XAMPP Control and stop the servers. The name of the XAMPP Control is "manager-osx". To start XAMPP simply open XAMPP Control and start Apache, MySQL and ProFTPD. The commands and tools are the same for both. Since XAMPP 5.5.30 and 5.6.14, XAMPP ships MariaDB instead of MySQL. XAMPP is now installed below the /Applications/XAMPP directory.
#Mac os x terminal start apache how to
In the next part of this series, we will show you how to install MySQL and make it all work together. It will show information of the current PHP configuration. Launch the file in the browser: localhost/phpinfo.php.
#Mac os x terminal start apache code
You can test it out by creating a PHP file named phpinfo.php in ~/Sites and put this code phpinfo() in. Technically, we can run a PHP website already. In this tutorial, we have configured PHP and Apache. Sudo launchctl load -w /System/Library/LaunchDaemons/ You might not want to launch Terminal and type sudo apachectl start repeatedly to start Apache server so let’s make it run automatically at startup. It will show all the directories that are stored within ~/Sites folder, as shown below. After all the above configurations, save nf and nf, and type the command below to restart Apache:Ĥ. Open nf and comment-out the following line by adding a hash sign, so it won’t listen to two ports at the same time.ģ. That way, I will not need to change the site urls for all my exisiting websites.ġ.
![mac os x terminal start apache mac os x terminal start apache](https://www.webcarpenter.com/pictures/screen-linux.jpg)
![mac os x terminal start apache mac os x terminal start apache](https://cdn.crunchify.com/wp-content/uploads/2013/02/Java-version-on-Mac-OS-X.png)
![mac os x terminal start apache mac os x terminal start apache](https://miro.medium.com/max/1104/1*EAoQhtsFJdTbHNzMI4bVew.png)
But, since I was using MAMP that uses port 8888, I’m making Apache point to this port number instead. Change the username with your OS X shortname account.Īpache, by default, run on port 80. Run the following command lines consecutively to create user-level configuration file. 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. 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.