Wednesday, 11 October 2017


How to install Apache,PHP and Mysql on MacOS-High-Sierra


In this tutorial we are going to see how to install Apache, PHP and Mysql in Macos-High-Sierra. By default Apache, PHP comes preinstalled along the OS installation. We just need to configure it in a right way.

1. To start we need to first start the service from terminal :-

sudo apachectl start

To restart, stop and status you can use the below command:-

sudo apachectl restart
sudo apachectl stop
sudo apachectl status

2. The Document root location is given below :-


3. Now edit the configuration file to enable some module :-

sudo nano /etc/apache2/httpd.conf

And make sure that this module is uncommented by default 2 modules will be uncommented.

LoadModule authz_core_module libexec/apache2/

LoadModule authz_host_module libexec/apache2/

LoadModule userdir_module libexec/apache2/

LoadModule include_module libexec/apache2/

LoadModule rewrite_module libexec/apache2/

4. Now enable rewrite mode from httpd.conf file like below :-

sudo nano /etc/apache2/httpd.conf

Save the file and restart the Apache once to take effect.

5. Now we will see how to add PHP module to Apache :-

sudo nano /etc/apache2/httpd.conf

Uncomment the below line to load PHP module :-

LoadModule php7_module libexec/apache2/

Save the file and restart Apache to take effect :-

sudo apachectl restart

For testing purpose you can create a phpinfo file in the below location :-

cd /Library/WebServer/Documents/
sudo vim info.php

Test the link below :- http://localhost/info.php

6. Download and install Mysql service like below :-

Download the version your require :-

Check the Mysql Installation and configuration in below video

Download the PhpMyadmin and copy it to Document Root :-

Follow the instruction like below :-

sudo cp -av /Library/WebServer/Documents/
cd /Library/WebServer/Documents/
sudo unzip
sudo mv phpMyAdmin-4.7.4-all-languages phpmyadmin
sudo chmod -R 777 phpmyadmin/
sudo apachectl restart

Now make the socket so that it can detect our phpmyadmin

sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Use the credential which you entered during mysql configuration 

That's it,
Enjoy using it 
Please do Share,Comments and Likes
Tags :

Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments

Follow by Email