MacOSX enables and disables apache servers and supports PHP

Source: Internet
Author: User
Tags fully qualified domain name
: 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.

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.