Rapid development of PHP environment for H5 fish and shrimp Crab Chess and board under Mac

Source: Internet
Author: User
Tags php development environment

Fast on the Mac H5 fish and shrimp Crab Board building PHP Development Environment Forum: aqiulian.com, more PHP build MVC development Environment Consulting q:212303635.

Recently done a back end of the project, is done with Php+mysql+nginx, so the way to build the environment simple summary.

Note:

    • Material: Apache/nginx+php+mysql+mamp
    • Mac OS 10.12.1 comes with Apache,nginx and PHP
1. Run Apache
    • To view the Apache version, enter the following command in the terminal root directory:

       sudo apachectl-v  

      Terminal will output Apache version and built time

      server version:apache/2.4.23 (Unix) Server Built:aug 8 2016 16:3 1:34  
    • To open Apache

      sudo Apachectl start  

      Opens, you can access it via the browser: http://localhost, the page displays "It Works" indicating success.

    • Close Apache

      sudo apachectl stop  
    • Restart Apache

      sudo apachectl restart
2. Configure PHP
    • Edit the Apache configuration file, terminal input:

       sudo vi/etc/apache2/httpd.conf  

      Found:

      # LoadModule php5_module libexec/apache2/libphp5.so  

      Remove the preceding "#" comment, and then: Wq Save exit

    • Copy an php.ini.default and name it php.ini

      sudo cp/etc/ Php.ini.default/etc/php.ini  
    • Restart Apache to make it effective

      sudo apachectl restart
3. Install MySQL
    • Download mysql:http://dev.mysql.com/downloads/mysql/   download after double-click installation, after successful, will pop up a prompt box:

      2017-02-12t09:00:08.587153z 1 [Note] A temporary password is generated for [email protected]: s; Qvtg#=i7wpif lose this password, please consult the sections how to Reset the Root password in the MySQL reference Manu Al.  

      This temporary password is difficult to remember, you can get rid of it.

    • Starts MySQL in safe mode and skips the secure password, and the terminal enters the following command:

      sudo Mysqld_safe--skip-grant-tables &  
    • To modify the MySQL password: the

      Principle is to modify the password for the root of the user field in Database:mysql table:user, The 5.7 version of the MySQL password field is authentication_string, and the lower version is called password;

      update user set Authentication_string=password ("Your PASSWORD
      ") where user=" root ";  
    • To refresh the permissions, exit the restart:

      MySQL> flush privileges;MySQL> quit;终端:service mysql start

      The password modification is complete, the password has been changed to root.

    • Open System Preference Configuration The bottom line->mysql,

      开启MySQL:Start MySQL Server关闭MySQL:Stop MySQL Server

      Note: Automatically Start MySQL Server on startup is checked by default, and when turned on the computer will turn on MySQL by default, it is recommended that you do not need to check the default

    • Too terminal view database inconvenient, can download Navicat Lite management software, management MySQL super convenient.

4. Big recruit, install Mamp
    • After installing Mamp, you will find that the things you do above are basically wasted ... Because this one is finished, the other basic do not need to move, in addition to slightly change the configuration of what.
    • Installation Address: https://www.mamp.info/en/ Install the free version is enough
    • Through the preferences settings can be set the project is Apache or Nginx, you can set the port number, you can also set the version number of PHP, and then you can point the folder to their own project, if not a new one, and finally only need to click Start.





    • Super convenient to have wood there!

      In this way, a complete engineering environment is set up, next, you can happily code!

Rapid development of PHP environment for H5 fish and shrimp Crab Chess and board 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.