Install Apache+php+mysql under Mac

Source: Internet
Author: User

Run "sudo apachectl start" and enter your account password so that Apache runs.

Run "sudo apachectl-v" and you will see the Apache version number in Mac OS X 10.6.3:

Server version:apache/2.2.14 (Unix)

Server Built:feb 11 2010 14:40:31

This allows you to enter "http://localhost" in the browser, and you can see that a content "It works!" appears Page, which is located under "/library (Resource Library)/webserver/documents/", which is the default root directory for Apache.

Run "sudo vi/etc/apache2/httpd.conf" in the terminal to open the Apache configuration file.

Find "#LoadModule php5_module libexec/apache2/libphp5.so", remove the previous #, Save (enter: W at the command line) and Exit VI (enter: Q on the command line).

Run "sudo cp/etc/php.ini.default/etc/php.ini" so that you can configure various PHP functions via php.ini.

Run "sudo apachectl restart" and restart Apache so PHP is ready to use.

Run "cp/library/webserver/documents/index.html.en/library/webserver/documents/info.php", That is, copy the Index.html.en file and rename it to info.php in the root directory of Apache.

Run "vi/library/webserver/document/info.php" in the terminal so that you can edit the info.php file in VI. In "It s works!" Add the following "<?php Phpinfo ();?>" and save it. This allows you to see information about PHP in http://localhost/info.php, such as the version number 5.3.1.

Install Apache+php+mysql under Mac

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.