PHP Development environment configuration of MAC system

Source: Internet
Author: User
Tags php development environment

The simplest and most straightforward way to do this is to use Apache and PHP, which comes with your Mac. 1. Launch Apache1> start Apache $sudo apachectl start; after 2> is started, enter localhost in the browser and you can see It works on the page. (Index.html.en file under/library/webserver/documents/)the default root directory for 3>apache is /library/webserver/documents/ 2. Add Apache support for PHP1> Open the http.conf configuration file:sudo vim/etc/apache2/httpd.conf2> Find the following code and remove the comment (remove the previous ' # '), Wq Save the exit. LoadModule Php5_module libexec/apache2/libphp5.so3. Restart Apache for PHP type file debuggingRestart : sudo apachectl restart Create a new project folder under the root directory of Apache/library/webserver/documents/and write a php file to output ' Hello World '. At this point, in the browser open http://localhost/project/test.php can normally see Hello World ~(If you have permission problems, sudo chown yourname:staff project where yourname is your own name) 4. Install MySQL using homebrewInstalling Homebrewruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"install MySQLBrew Install MySQLstart MySQLmysql.server StartApache Common Commands//Start Apache servicesudo apachectl start //Restart Apache service sudo apachectl restart //close Apache service sudo apachectl stop //view Apache version httpd-v

PHP Development environment configuration of MAC system

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.