Tutorial on configuring the PHP environment _ PHP in Windwos8.1

Source: Internet
Author: User
Tags php file upload vc9
Configure the PHP environment in Windwos8.1. 1. download the installation package: Apache2.2: mirrors. cnnic. cnapachehttpdbinarieswin32httpd-2.2.25-win32-x86-openssl-0.9.8y.msiPHP5.4: windows. php. netdownloadsrelea I. 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 software version is not limited to the above, but there are two points to note:

First, openssl in the Apache software package indicates that the openssl module is included. you can use openssl to configure an SSL link for Apache. if you use PHP in apache1 or apache2, you should select the VC6 version, if you use PHP in IIS, you should select the version of VC9;

Second, the difference between VC6 and VC9 in the PHP package: VC6 is compiled using visual studio 6, while VC9 is compiled using Visual Studio 2008, it also improves the performance and stability of using VC9 in Apache. to use PHP of VC9, you need to install Microsoft 2008 C ++ Runtime. Therefore, we recommend that you do not use VC9 in Apache.

In addition, it is our directory structure. to facilitate management, we install them in one piece. First, we create the WAMP folder, and then create the MySQL, PHP, and Apache folders respectively, later, we will install MySQL, PHP, and Apache in the corresponding folders. The directory structure is as follows:

II.Install software (many installation tutorials on the Internet are not mentioned here)

III.ApacheAnd PHP configuration

Find the php. ini-recommended file in the WAMPPHP folder, rename it to php. ini, and open it in the editor.

1. first find

 ; Directory in which the loadable extensions (modules) reside.  extension_dir = "./"

To:

; Directory in which the loadable extensions (modules) reside.= "D:/Program Files/WAMP/PHP/ext"

(I installed it in the directory of Program Files on drive D, you can change it according to the actual situation) to specify the Directory of the PHP extension package, so as to call the corresponding DLL file

2. enable the extended library function

Find the following lines and remove the previous ";"

extension=php_curl.=php_gd2.=php_mbstring.=php_mysql.=php_mysqli.=php_pdo_mysql.=php_xmlrpc.dll

3. configure the PHP Session function

When using the session function, you must configure the session file storage directory on the server. Otherwise, you cannot use the session. you need to create a read/write directory folder. in this case, we will create the phpSessionTmp directory in the WAMP folder, then in php. in the INI file, find

;session.save_path = "/tmp"

To:

session.save_path = " D:/Program Files /WAMP/phpSessionTmp"

4. configure the PHP file upload function

When using the PHP file upload function, you must specify a temporary folder to complete the file upload function. Create a phpFileUploadTmp folder in the WAMP folder, and find

;upload_tmp_dir =

To:

upload_tmp_dir = "D: /Program Files /WAMP/phpFileUploadTmp"

5. modify date. timezone. the default value is the U.S. time. if it is not modified, an error is returned.

Find:

;.timezone =

To:

;.timezone = Asia/Shanghai

Well, the configuration of php. ini is complete, but this is not enough. we need Apache to support PHP, so we have to complete the corresponding PHP configuration in the Apache configuration file httpd. conf.

Find the httpd. conf file in the D: \ Program Files \ Wamp \ Apache \ conf folder and open

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

LoadModule php5_module "D:/Program Files/WAMP/PHP/php5apache2_2.dll""D:/Program Files/WAMP/PHP"/x-httpd-php .php .html .htm

7. by default, the Directory of the main web program executed by the Apache server is Apache2.2/htdocs. for convenience, we have created a www folder in the WAMP to replace htdocs, therefore, you need to modify the Apache configuration. The web program directory is changed to the www directory.

Find:

DocumentRoot "D:/Program Files/WAMP/Apache/htdocs"

To:

DocumentRoot " D:/Program Files/WAMP/wwwroot"

Find:

 

Change

 

8. finally, modify the order of the index file. because the PHP function is configured, index. php is required for priority execution.

Find:

DirectoryIndex index.html

To:

DirectoryIndex index.php .php index.html index.htm .html .htm

Now, the PHP environment configuration is basically complete. let's give it a try.

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

 

Then, enter http: // localhost/phpinfo. php in the address bar of the browser. then, the page displays the basic configuration information of PHP, and our PHP environment is complete.

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.