Mac PHP configuration and macphp Configuration

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.