: This article mainly introduces how to enable and disable the apache server to support PHP. if you are interested in the PHP Tutorial, refer to it. 1. start
Sudo apachectl-k start
2. restart
Sudo apachectl-k restart
3. disable
Sudo apachectl-k stop
(After closing, remember to clear the browser cache, otherwise it works will appear when you enter the localhost URL)
//----------------------------------------------------------------
Apache supports PHP
1 ?? Go to the/etc/apache2 folder
2 ?? Copy the httpd. conf file to the desktop. (the system file cannot be modified. enter the user password)
3 ?? Use text editing to open httpd. conf
4 ?? Find # LoadModule php5_module... delete the previous # and save
5 ?? Copy the httpd. conf file modified on the desktop to/etc/apache2 and select overwrite (enter the user password)
6 ?? Start apache
Apache startup error: httpd: cocould not reliably determine the server's fully qualified domain name
Httpd: cocould not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
1 ?? Go to the/etc/apache2 folder
2 ?? Copy the httpd. conf file to the desktop. (the system file cannot be modified. enter the user password)
3 ?? Use text editing to open httpd. conf
4 ?? Find # ServerName www.example.com: 80 and change it to ServerName localhost: 80.
5 ?? Copy the httpd. conf file modified on the desktop to/etc/apache2 and select overwrite (enter the user password)
6 ?? Restart apache
//----------------------------------------------------------------
Friends who are used to using command lines can use command lines.
Go to the directory where the Apache configuration file is located
Cd/etc/apache2/
Modify the Apache configuration file
Sudo vim httpd. conf
Vim has two command modes, which are used to input commands (note that the input method must be in the English state) shift + V you can select a row y to copy a row p and paste the copied content below the current row d $ delete to the end of the row x delete a character: wq save exit: q! Do not save exit I enter edit mode: used to edit press ESC can switch back to command mode
Sudo cp file1 file2 copy file1 to file2
The specific operations on the command line are not detailed. if you prefer to use the command line, you can try it yourself.
The above describes how to enable and disable the apache server for Mac OS X to support PHP, including some content, and hope to help those who are interested in the PHP Tutorial.