Friday, December 24, 2021

How to setup drush & composer and Create virtual host with MAMP VM and Mac.

 Step 1: Install MAMP


Start:- MAMP starts manually with the click MAMP icon + click on right side button.




Step:-  How to start MAMP apache server using command.


Start:-Then use it like  sudo /Applications/MAMP/bin/startApache.sh


Stop:- Then use it like sudo /Applications/MAMP/bin/stopApache.sh


Step :-  How to start MAMP sql server using command.


Start:-Then use it like cd /Applications/MAMP/bin./startMysql.sh 


Stop:- Then use it like cd /Applications/MAMP/bin./stopMysql.sh 


Step 3:-  How to install the composer on mac globally.


We need to install the mamp and after that we have to check the php version if the php version command is not found to run the command which I have to share.


Then use it like  vi ~/.zshrc

Then use it like source .zshrc


Now we have to check php version simply write the terminal


  which php


 Then show line like this   /Applications/MAMP/bin/php/php7.4.21/bin/php


Then, After we have installed the composer in our system so goto the link which i have shared

https://getcomposer.org/download/

Copy all the code and the terminal.


I have shared the steps which I have followed below the screen shot.



After move to globally composer use the below command


sudo mv composer.phar /usr/local/bin/composer

Install drush using composer command globally

composer global require drush/drush

Step 4:-  How to create the virtual host in mac.

Host file 


Step 1:- You can just open the terminal and run the comment 


=> cd  /private/etc/


Step 2:- Now you are in inside the directory simply run the command


=> ls



Step 3:- Now we need to show the hidden file like permission of the file which we need to show 


=> ls -all 


Step 4:- Now we are going to open host file show we need to use the command


=> sudo nano hosts



Ctrl + x,y => enter



Step 5: Now we have to clear our terminal so simply


Ctrl + k 



Httpd.conf Setting


Step 6: Now I am going to setting the httpd file so we have changed the directory of file 


=> cd /Applications/MAMP/conf/apache



After that we have to ran the command like


=> nano httpd.conf



And now comment the line of code which I have shared the screen shot





Step 7: Now we have to configure the Vhost file


=> cd extra/


Now show the hidden files


=>ls -al



Step 8 :Now open the httpd-vhost.conf


=>nano httpd-vhosts.conf



Now we can restart the system and also restart the apache server


Output=

=> Start the apache


sudo /Applications/MAMP/bin/startApache.sh












No comments:

Post a Comment

If you have any problem please let me know.