Windwos8.1 Configuring the PHP Environment _php tutorial

Source: Internet
Author: User
Tags php file upload phpinfo vc9 microsoft c
A. To Download the installation package:

Apache2.2:http://mirrors.cnnic.cn/apache//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi

Php5.4:http://windows.php.net/downloads/releases/php-5.4.22-win32-vc9-x86.zip

Mysql5.5:http://dev.mysql.com/get/downloads/mysql-5.5/mysql-5.5.35-winx64.msi

Of course the version of the software is not limited to the above, but there are still two points to note:

First, OpenSSL in the Apache package indicates that with the OpenSSL module, using OpenSSL to configure SSL secure links for Apache, if you use PHP under Apache1 or apache2, you should choose VC6 version, If you use PHP under IIS you should choose the VC9 version;

Second, the difference between VC6 and VC9 in PHP packages: The VC6 version is compiled with Visual Studio 6, and VC9 is compiled with Visual Studio 2008, and improves the performance and stability of versions that do not use VC9 under Apache. Using the VC9 version of PHP requires the installation of the Microsoft C + + Runtime, so it is not recommended to use the VC9 version under Apache.

The other is our directory structure, in order to facilitate the management, we put them in a piece, first set up the Wamp folder, and then built in the MySQL, PHP, Apache folder, and then we will MySQL, PHP, Apache respectively installed in the corresponding folder. Directory structure such as:

two. Install the software (many installation tutorials on the web, not here)

three. configuration of Apache and PHP

Locate the php.ini-recommended file in the folder wampphp, rename it to PHP.ini, and open it with the editor

1, first find

< span="">; Directory in which the loadable Extensions (modules) reside.  < span=""> extension_dir = ". < span=""> /"

Modified to:

; Directory in which the loadable Extensions (modules) reside. = "D:/program < span=""> files/wamp/php/ext"

(My is installed in the Program Files directory in the D drive, you can change according to the actual situation) represents the specific directory of the specified PHP expansion pack, in order to invoke the corresponding DLL file

2, open the corresponding expansion library function

Find the following lines and put the front ";" Remove

Extension=php_curl.  < span=""> =php_gd2.  < span=""> =php_mbstring.  < span=""> =php_mysql.  < span=""> =php_mysqli.  < span=""> =php_pdo_mysql.  < span=""> =php_xmlrpc.dll

3. Configure the session function of PHP

When using the session function, you must configure the session file on the server to save the directory, or you can not use the session, you need to build a read-write directory folder, then we phpsessiontmp directory in the Wamp folder, and find it in the php.ini file.

; Session.save_path = "/tmp"

Modified to:

Session.save_path = "D:/program files/wamp/phpsessiontmp"

4, configure the PHP file upload function

When using the php file upload feature, you must specify a temporary folder to complete the file upload function. Below, create a phpfileuploadtmp folder in the Wamp folder and find it in the php.ini file.

; Upload_tmp_dir =

Modified to:

Upload_tmp_dir = "D:/program files/wamp/phpfileuploadtmp"

5, modify the Date.timezone, the default is the United States time, if not modified will error

Found it:

; . TimeZone = < span="">

Modified to:

; . TimeZone = Asia/shanghai < span="">

Well, the configuration for php.ini is complete, but that's not enough, we need Apache to support PHP, so we have to complete the PHP configuration in the Apache configuration file httpd.conf.

Locate the httpd.conf file in the D:\Program files\wamp\apache\conf folder and open

6, add under #loadmodule vhost_alias_module modules/mod_vhost_alias.so:

LoadModule php5_module "D:/program files/wamp/php/php5apache2_2.dll< span="">" "D:/program files/wamp/php"  /x-httpd-php. php. html < span=""> . htm

7, because by default Apache server executes the Web main program directory for Apache2.2/htdocs, for convenience, we built the WWW folder in Wamp to replace the htdocs, so at this time need to modify the corresponding Apache configuration, The Web program directory becomes WWW directory

Found it:

DocumentRoot "D:/program Files/wamp/apache/htdocs"

Modified to:

DocumentRoot "D:/program files/wamp/wwwroot"

Found it:

 
  

Revision changed to

 
  

8, finally change the order of index file, due to the configuration of PHP function, of course, need to index.php priority execution

Found it:

DirectoryIndex index.html

Modified to:

< span="">< span="">< span="">. htm

At this point, the environment configuration of PHP is basically completed, let's try It

Restart Apache, place a phpinfo.php file inside the Wamp/wwwroot, and write the code in phpinfo.php:

 
  < span="">< span="">?>

Then enter http://localhost/phpinfo.php in the browser address bar, when the Web page shows the basic PHP configuration information, then our PHP environment is finished.

http://www.bkjia.com/PHPjc/626645.html www.bkjia.com true http://www.bkjia.com/PHPjc/626645.html techarticle A. Download the installation package: Apache2.2:http://mirrors.cnnic.cn/apache//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi Php5.4:http://windows.php.net/downloads/relea ...

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