Mac PHP configuration and macphp Configuration
The default path configuration method of apache is already provided by apache. You only need to run the following three commands. Start apache service sudo apachectl start stop apache service sudo apachectl stop restart service sudo apachectl restart check version httpd-v manually open apache service, enter localhost in the browser, you will see the following: it worksPHPConfigurationThe configuration of PHP is very simple. Just go to the/etc/apache2/directory, edit httpd. conf, find LoadModule php5_module libexec/apache2/libphp5.so, and just release the comments. Restart apache. Create a PHP file in the/Library/WebServer/Documents/directory for testing. The root directory of the virtual directory configuration method program is under/Library/WebServer/Documents/. This It works is printed by info. php. The following describes how to change the default directory of apache to the user directory. 1. Create a new Sites folder under your user directory. My user directory is yanzi 2, go to the cd/etc/apache2/users/directory, and sudo vim username. conf. The content is: <Directory "/Users/yanzi/Sites/"> AllowOverride AllOptions Indexes MultiViews FollowSymLinksRequire all granted </Directory>. The yanzi In the first row above is the user Directory. Then change the File Permission to 644: sudo chmod 644 username. conf 3, enter the/etc/apache2/directory, sudo vim httpd. conf removes the comments of the following three sentences: LoadModule authz_core_module libexec/apache2/mod_authz_core.soLoadModule authz_host_module libexec/apache2/mod_authz_host.soLoadModule userdir_module libexec/apache2/example, release the third sentence. Then find Include/private/etc/apache2/extra/httpd-userdir.conf comments to release. PS: in vim, you only need to switch to the command mode and enter/"words you need find" to quickly find the words to be searched. 4, into the/etc/apache2/extra/directory, sudo vim httpd-userdir.conf will Include/private/etc/apache2/users/*. conf this sentence open comments. Then enter sudo apachectl restart to restart apache, and enter loacal/~ in the browser /~ Yanzi/to see the effect. (Yanzi is the name of my user directory and does not need to be added later.) After the above steps, apache will do a good job.