Configure Apache2 (IIS) + PHP5 + MYSQL6 + Zend in Windows

Source: Internet
Author: User
In Windows, configure Apache2 (IIS) + PHP5 + MYSQL6 + Zend,: Apache2.0.63: archive. apache. orgdisthttpdPHP5.2.6: cn2.php.netgetphp-5.2.6-Win32.zip fromamirrorMYSQL6.0.3: dev. mysql. comdownloadsmysql

Windows configuration Apache2 (IIS) + PHP5 + MYSQL6 + Zend one,: Apache2.0.63: http://archive.apache.org/dist/httpd/ PHP 5.2.6: http://cn2.php.net/get/php-5.2.6 -Win32.zip/from/a/mirror MYSQL 6.0.3: http://dev.mysql.com/downloads/mysql

WindowsConfigure Apache2 (IIS) + PHP5 + MYSQL6 + Zend

I,:

Apache2.0.63: http://archive.apache.org/dist/httpd/
PHP 5.2.6 : Http://cn2.php.net/get/php- 5.2.6 -Win32.zip/from/a/mirror

MYSQL 6.0.3 : Http://dev.mysql.com/downloads/mysql/6.0.html Zend-3.3.0? Pid = 13

The installation and installation sequence of the software is listed above. Only the zip package of PHP can be decompressed directly. The last installation of Zend is completed. It will only be installed after all the operations are complete.

Ii. installation and configuration process:

(1)Apache(IIS)

Apache installation is very simple. I directly installed it under D:/program/apache2, all the way to NEXT. After agreeing to the license agreement, there will be a page to fill in the server information, because it is local debugging, set "localhost" for "network domain" and "servername" to "administrator's email address" and "NEXT" until "FINISH". Apache starts related services, run an Apache monitor in the lower-right corner of the taskbar to test whether Apache is successfully installed. Open a browser and enter http: // localhost/. The "It Works!" page is displayed! ", Indicates that Apache installation is OK ~ After installation, My apache directory is D:/program/apache2.

If you use the iis server, install IIS here. Other installation steps remain the same.

(2) PHP

Directly decompress the package to the D:/program/php Directory, which facilitates searching for files.

(3) Mysql:

Directly mount to D:/program/MysqlAfter the installation is complete, open the cmd Command Prompt window, enter the command: MySQL-u root-p and enter the password. If you can enter the MySQL console normally, the MySQL installation is normal.

After testing, you can put the database file in a separate directory to speed up database access. Next, you can change the MySQL database directory. This step is not required.

A) Open the cmd Command Prompt window and enter the command: net stop MySQL to stop the MySQL service;

B) Open D:/program/MySQL/my. ini.

Find:

Datadir = "D:/program/MySQL/data"

To:

Datadir = "D:/Database"

C) copy the D:/program/MySQL/data folder to D:/and rename it D:/Database;

D) Open the cmd Command Prompt window and enter the command: net start MySQL to start the MySQL service.

E) re-test whether MySQL works normally.

(4) Configuration

1. Configure Apache

1. Load the php Module

Run PHP directly as a module of apache and add it to the http. conf file:

LoadModule php5_module "D:/program/php/php5apache2. dll"

AddType application/x-httpd-php. php

2. Modify the website directory

In the D:/program directory, create a www directory to store my site files, and change it in http. conf:

Change DocumentRoot "D:/program/Apache2/htdocs" to DocumentRoot "D:/program/www"

3. Modify the List Directory attributes (optional)

Compared with 1.3.x, Apache2.0.x cannot directly list directories by default:

Set

Options FollowSymLinks

AllowOverride None

Changed:

Options Indexes FollowSymLinks

AllowOverride None

Set the default apache characters to simplified Chinese characters:

Adddefacharcharset GB2312

4. Modify the default home page of the directory:

After DirectoryIndex, write the file name you want to set as the homepage, for example, index.html index. php.

Note that to make these configurations take effect, restart apache.

2. Configure PHP php. ini

1. Copy php. ini-dist to C:/windows and rename it php. ini.

2, and then modified the following:

Find: extension_dir = ". /"change it to extension_dir =" D:/program/php/ext "(specify the directory of the dynamic Connection Library. The difference between php5 and php4 is that its dynamic Connection Library directory has changed, this is detailed in its document structure ).

3. Find Windows Extensions.

In the dynamic module configuration under Windows Extensions, You need to enable the following module support: (remove the number before each line of the module configuration)

Extension = php_mbstring.dll

Extension = php_gd2.dll

Extension = php_MySQL.dll

4. Next, modify some file uploads and the maximum memory usage limit:

Memory_limit = 20 M

Post_max_size = 20 M

Upload_max_filesize = 20 M

Nothing else can be changed. After modifying php. ini, You need to restart apache.

5. Find:

Disable_functions =

Changed:

Disable_functions = passthru, exec, system, chroot, scandir, chgrp, chown, shell_exec, proc_open, primary, ini_alter, ini_alter, primary, dl, pfsockopen, openlog, syslog, readlink, symlink, popepassthru, stream_socket_server

6. Save the php. ini file and copy it to C:/Windows/

Next, copy libmysql. dll and libmysqli. dll under the php Directory to windows/system32. If this is not done, the mysql dynamic Connection Library cannot be loaded normally.

Iii. IIS configuration (optional)

If you select IIS, complete the iis configuration here. The following describes how to configure iis:

(1) Start IIS manager and create a new website (virtual host)

(2) enter the website name. If the name is changed to the ID in IIS, enter the website name as needed.

(3) You do not need to enter the website IP address. If the port does not have special requirements, you can keep it at 80. Finally, enter the website domain name correctly.

(4) Create wwwroot and bbs in the website partition.

(5) For PHP applications, you must grant the site the "read" and "run script" Permissions

(6) Now, a site has been successfully created.

IIS and PHP integrated configuration-make the site support PHP

(1) Open the website properties you just created. In the site Properties window, click the "main directory" tab and click the "Configure" button, in the displayed "application configuration" dialog box, click "add" to add ISAPI support for PHP. Select the executable file D:/program/PHP/php5isapi. dll, the extension is. php: GET and POST. Click "OK" to add and check whether the. php extension is successfully loaded in the "Application configuration" window. If yes, click OK to close the Configuration window and return to the main site Properties window.

(2) Click the "document" tab, add index.htm?index.html and index. php files to the default content document, and sort all default documents in sequence as shown in. Click OK to close the site property Configuration window and return to the main interface of IIS manager.

(3) Right-click "Web Service extension" to add PHP extension support.

(4) In the "new WEB service extension" dialog box shown in, enter PHP for "extension", and select D:/program/PHP/php5isapi for "File. dll, and set this PHP extension to allow by default.

(6) restart the IIS service.

(5) Zend

Now that both Apache and PHP are configured, restart the Apache server and write the following statement in the Editor:

;

Save the file name as "phpinfo. php "to the user's main directory (in this example, d:/program/www) directory, then open the browser, browse: http: // localhost/phpinfo. php. If the basic PHP information is displayed, the configuration is successful.

After all the debugging operations are normal, I mounted Zend to D:/program/zend and double-click the downloaded ZendOptimizer- 3.2.6 -Windows-i386.exe file, the installation process is very friendly, but pay attention to the following points:

(1) Prompt php during installation. the position of ini is: Check whether it is C:/Windows. If it is not required to be manually specified as C:/Windows, the Apache service is automatically restarted after Zend Optimizer is installed, after restart, open the IE browser window again to view phpinfo. php support information. Check whether Zend Optimizer support information is included. If not, it indicates that Zend Optimizer has not been installed successfully!

Finally, modify the php. ini file and add the phpinfo function to disable_functions.

Postscript: This article details the configuration of the php server in windows. I wrote this article to install the discuz forum, but when installing the discuz Forum, once the mysql database is created, apache reports an error, and the memory cannot be read. After a long time, I found that I used libmysql In the mysql installation directory. if the dll is copied to system32, it may be a problem with database connection. Copy libmysql. dll under the php installation directory to system32 and run it again! This problem has plagued me for several hours and I hope to learn from it. Pay attention to version matching.

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.