Use MAMP to build a PHP development environment on a Mac system

1. Download MAMP Kit

The download address is https://www.mamp.info/en/

2. Install this .dmg file

3. Configure apache virtual host

(1) Find the httpd.conf file in /Applications/MAMP/conf/apache

found in this file

# Virtual hosts

Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

remove the preceding #

(2) Find the httpd-vhosts.conf file in /Applications/MAMP/conf/apache/extra and configure the virtual host as follows:

<VirtualHost *:80>
    ServerAdmin localhost
    DocumentRoot "/Applications/MAMP/htdocs/"
    ServerName localhost
    ErrorLog "logs/localhost-error_log"
    CustomLog "logs/localhost-access_log" common
    DirectoryIndex index.html index.htm index.php
    <Directory />
        Options FollowSymLinks
        #Do not allow others to modify our page
        AllowOverride None
        #Set access permissions
        order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

(3) Configure the /etc/hosts file as follows:

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

127.0.0.1       www.test.com
127.0.0.1       local.erp.com

4. Test:

Enter localhost:8888/index.php in your browser

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325353719&siteId=291194637