Configuring the operating environment for PHP56

Source: Internet
Author: User
Required raw materials: (Provide links)

    • Php-5.6.10-win32-vc11-x86 (Zip) (Note that the PHP version is divided into IIS and Apache versions)
    • HTTPD-2.4.12-X86-R2 (Apache) (Zip)
    • MySQL Database (free installation version)

Configuration steps:

PHP section

    • Unzip the downloaded zip archive to get the php5.6 folder

Rename the php.ini-development in this folder to PHP.ini as the PHP configuration file.

Modify PHP.ini

1. Set the specific directory for the PHP expansion pack to find

; On Windows:

; Extension_dir = "ext"

Change to (value is the directory of Ext folder)

; On Windows:

Extension_dir = "D:/develop/php/ext"

2. Turn on the library function to locate the row of the library you want to open

; Extension=php_curl.dll

; Extension=php_gd2.dll

; Extension=php_mbstring.dll

; Extension=php_mysql.dll

; Extension=php_xmlrpc.dll

Remove the preceding semicolon (note) and change to

Extension=php_curl.dll

Extension=php_gd2.dll

Extension=php_mbstring.dll

Extension=php_mysql.dll

Extension=php_xmlrpc.dll

3. Set the time zone to find

;d Ate.timezone =

Switch

Date.timezone = Asia/shanghai

Apache section

    • Unzip the downloaded Apache Zip archive to get the Apache24 folder

    First modify the Apache configuration file, let Apache support parsing php files.

    Apache configuration files are httpd.conf in the Conf directory of the Apache directory.

    1. Allow Apache to parse the PHP file and locate it in the configuration file

    #LoadModule Vhost_alias_module modules/mod_vhost_alias.so

    Add on the next line (the green location is based on the directory where PHP is located)

    LoadModule php5_module "D:/develop/php/php5apache2_4.dll"

    #注意红色部分可能由于php版本的不同而有所改变

    Phpinidir "d:/develop/php"

    AddType application/x-httpd-php. php. html. htm

    2. Found in the configuration file

    DirectoryIndex index.html

    Switch

    DirectoryIndex index.php index.html

    3. Modify the Apache Site Directory, found in the configuration file (Apache installed directory, different values displayed)

    DocumentRoot "D:/develop/apache2.2/htdocs"

    Switch

    DocumentRoot "d:/workspace/php"

    Find it again.

            

    Switch

               

    Configuration is complete to detect the success of the configuration. Restart Apache, in the Site directory, create a new file index.php, enter the content:

     
       PHPphpinfo();? >

MySQL section

    • After decompression can rename the folder, put in the appropriate location, personal suggestions to rename the folder to MySQLServer5.6, placed in the C:\Program files\mysql path. Of course you can put it anywhere you want.
    • Configuring environment variables is simple: My Computer, Properties---Advanced environment variable select Path, followed by add: The path to your MySQL bin folder (e.g.: C:\Program files\mysql\mysqlserver5.6\bin )

Path= ...; C:\Program Files\mysql\mysqlserver5.6\bin (note is append, not overwrite)

    • To modify the MySQL configuration file:

MYSQL-5.6.1X The default configuration file is C:\Program files\mysql\mysql Server 5.6\my-default.ini

In which the configuration () is modified or added:

[Mysqld]

Basedir=c:\program files\mysql\mysqlserver5.6 (MySQL directory)

Datadir=c:\program files\mysql\mysqlserver5.6\data (MySQL directory \data)

  • Run cmd as administrator (be sure to run as administrator, or not have enough permissions),

    Input: cd C:\Program Files\mysql\mysqlserver5.6\bin into the bin folder of MySQL (regardless of whether you have configured the environment variable, also to enter the Bin folder, or after the start of the service will still report error 2)

    Enter Mysqld-install (if run without administrator, there will be an error due to insufficient permissions: Install/remove of the Service denied!)

    Installation Successful

  • After the installation is successful, start the service, continue to enter in cmd: net start MySQL (), the service started successfully

  • Alternate command for error, delete mysql (input mysqld-remove)

  • Error condition (Error 1067, which is the configuration file modification error, verify that the configuration file is correct.) Error 2 "The system cannot find the file", check whether the configuration file has been modified or whether it is entered in the Bin directory)

  • After the service started successfully, you can log in, enter Mysql-u root-p (no password for the first login, press ENTER directly), Login success!

  • Attention:

    The My.ini file must be encoded in English (such as ANSI in Windows), not UTF-8 or GBK, and so on.

    Reference Links:

  • Http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html

  • Http://www.cnblogs.com/pharen/archive/2012/02/06/2340628.html

  • The above describes the configuration of the PHP56 environment, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.