Windows iis6/apache2.2.4+mysql5.2+php5.2.1 Installation configuration method _php Tips

Source: Internet
Author: User
Tags install php php book phpinfo win32 zend

03 has seen a PHP book, then or PhP3, looking back on the Web four PHP in the future of the Open is really a bright ah! Three years of missing PHP to see the php5, now I really start from writing the first PHP Web from the beginning is still three or four months, with work is doing www.kuomart.com site, back to the original has been used windows2003+iis6+ php5.0.7+mysql4.1 in the development, until yesterday the machine heavy Trojan, Kav also did not find out why, oneself find also did not find any suspicious exposure point, so simply reload a bit XP, because TV1000 TV card can only in XP into normal operation, Previous configuration was successful under 2003 system, but hardware error blue screen! So simply put 2003 of my development environment under the Web Development Section also under XP to install a part. Very want to install the lamp environment, but considering the machine on the data too much, the operation of trouble, and so the money to buy a hard drive or on the whim of the day to say it. So I started to configure the environment at noon today!

To http://www.apache.org download the latest version of Apache apache.2.24, install how did not find service, originally I chose only the second item, select this need to manually add Windows service! Baidu for a while to understand, so if you are the first installation has been the next step do not go into the setting of what is not necessary, the operation will certainly ok!
Next is the installation of PHP, I began to install the php5.0.4,4, install PHP I will not say more, the following will be the information I found posted. Then is the Apache support PHP configuration, of course, is modified httpd.conf, but I

Use Notepad to open C:\Program files\apache Software foundation\apache2.2\conf\httpd.conf This file for modification:
① Find:
AddType application/x-gzip. GZ tgz
Add the following lines below:
AddType application/x-httpd-php. php
AddType application/x-httpd-php. PhP4
AddType application/x-httpd-php. php3
AddType application/x-httpd-php. phtml
AddType Application/x-httpd-php-source. Phps
AddType Image/x-icon. ico
② Find:
#LoadModule Ssl_module modules/mod_ssl.so
Add a line below:
LoadModule Php5_module C:\php5\php5apache2_2.dll
(Special note: If your Apache version is 1.x, here should be: LoadModule php5_module C:\php5\ Php5apache.dll If your Apache version is 2.0.x-2.2.x, here should be: LoadModule php5_module C:\php5\php5apache2.dll, I've had a lot of trouble finding this here! )
③ Find:
DirectoryIndex index.php ...
This line, you can modify this to add the default filename:
DirectoryIndex index.php default.php index.htm index.html default.htm

It's not right to add LoadModule php5_module C:\php5\php5apache2_2.dll.
Requested error

Of course this situation is usually Baidu or Google, the original is a variety of versions of the problem, I think it should be, find the corresponding configuration data as follows:

I. Download the latest apache2.24,mysql5.2,php5.2.1[download address: http://cn.php.net/downloads.php Note: Download Php-5.2.1-win32 and Pecl-5.2.1-win32 (expansion packs) at the same time, the format is the kind of uncompressed, rather than EXE or MSI, etc. directly installed. (Please search by Baidu for specific address).

Two. Installation Configuration PHP5.2.1
1. Uncompressed PHP5.2.1 compressed packets to C:\PHP5 (this path and file name can be arbitrary, but the following if you use this path and file name, if you are not using the path and file name, please make the appropriate changes).
2. Copy the following files from the C:\PHP5 directory into the Windows System folder, depending on the version of Windows (if it is windows9x/me, c:\windows\syste; if it is a Windows nt/ 2000 is C:\Winnt\System32, or c:\windows\system32 if it is a Windows xp/server2003. where C:\ for the operating system you are now using the OS disk, if your current operating system is not installed under C:\windows, please make changes accordingly.
Php5ts.dll
Fdftk.dll
Fribidi.dll
Gds32.dll
Libeay32.dll
Libmcrypt.dll
Libmhash.dll
Libmysql.dll
Libswish-e.dll
Msql.dll
Ntwdblib.dll
Ssleay32.dll
Yaz.dll
3. Rename the file Php.ini-dist in the C:\PHP5 directory to php.ini (this profile automatically adds "//" to all additions, adding security, and adding to the hassle If the php.ini-recommended is renamed PHP.ini, the profile does not add "//" to the added content, which reduces security but is more convenient. Choose which one to decide, copy php.ini to C:\windows\ (xp/2003/9x/me) or C:\Winnt\ (2000/NT), open with Notepad, and make the following modifications:
① search extension_dir=./This line, and refer its path to the extensions directory in your PHP directory, modified to: Extension_dir = C:\PHP5\ext
② If you want to support more modules, please take the following to do, if not, save the php.ini file directly.
PHP supports a lot of modules, but some DLLs are not free, so there is no compression package with PHP release, but the DLLs folder is very much, we have just copied them to the System32 folder, and now we test to see how many modules it supports. The following is my test results, for reference only, if the installation is completed, pop-up does not support the Xxx.dll module, the front semicolon can be added directly to the. Search:
; Windows Extensions
; Note that MySQL and ODBC support are now built in, so no DLL are needed for it.

The following semicolon in the previous comment out the support of the extension module, if you want to support a module PHP, please forward the ";" Remove can, the following is my test results, generally follow the following way to remove comments after no problem:
Extension=php_bz2.dll
Extension=php_cpdf.dll
Extension=php_crack.dll
Extension=php_curl.dll
Extension=php_db.dll
Extension=php_dba.dll
Extension=php_dbase.dll
Extension=php_dbx.dll
Extension=php_domxml.dll
Extension=php_exif.dll
Extension=php_fdf.dll
Extension=php_filepro.dll
Extension=php_gd2.dll
Extension=php_gettext.dll
Extension=php_hyperwave.dll
Extension=php_iconv.dll
; Extension=php_ifx.dll
; Extension=php_iisfunc.dll
Extension=php_imap.dll
Extension=php_interbase.dll
Extension=php_java.dll
Extension=php_ldap.dll
Extension=php_mbstring.dll
; Extension=php_mcrypt.dll
Extension=php_mhash.dll
Extension=php_mime_magic.dll
Extension=php_ming.dll
Extension=php_mssql.dll
Extension=php_msql.dll
; Extension=php_oci8.dll
Extension=php_openssl.dll
; Extension=php_oracle.dll
Extension=php_pdf.dll
Extension=php_pgsql.dll
; Extension=php_printer.dll
Extension=php_shmop.dll
Extension=php_snmp.dll
Extension=php_sockets.dll
; Extension=php_sybase_ct.dll
Extension=php_w32api.dll
Extension=php_xmlrpc.dll
Extension=php_xslt.dll
Extension=php_yaz.dll
Extension=php_zip.dll
After the modification is complete, save the php.ini.
③ Unzip the Pecl-5.2.1-win32.rar package and copy all of the files to the C:\PHP5\ext folder. (This folder is where the extended files for PHP5.2.1 are stored, and if you have PHP extensions in C, you can also put them under that folder)
④ a new folder under the C:\PHP5 directory, named: Session. (this folder is used to save sessions, because PHP does not have a long memory variable like application in ASP, so the session is almost the only option for saving initial query conditions for paging or shopping carts.) However, the folder needs to be cleaned regularly later.

This completes the installation and configuration of PHP.

Three. Installation of MySQL
MySQL is relatively independent, the database is very small, not directly to operate it, unlike access or SQL2000, there are graphical management tools, but there are many graphical management software to operate it well, such as: EMS SQL Manager 2005 For MySQL (highly recommended for the best MySQL management software), NAVICAT,PHPMYADMIN,MYSQLCC. These software can be downloaded to the Internet, not described in detail.
1. Download access to MySQL for Win32 installation package, open with WinZip, direct run Setup.exe, you need to pay attention to select an installation path, of course, the installation path can be arbitrary, but it is recommended to install with PHP, select the C:\MySQL directory.
2. mysql automatically enters the setup stage after the installation completes. Configure by default, and then enter the password to complete the setup. (The default username is root and the password is blank)
3. After the general installation of MySQL will automatically start the service, if not started, please double-click C:\MySQL\bin\mysqld-nt.exe run.
4. If you have already downloaded several of the management software mentioned above, you can use them for MySQL management.

Four. Configuration of IIS (with the fifth optional)
Open IIS, right-click on the default Web site, and make the settings in the home directory as shown in the following illustration, and note the steps:


After the completion of the IIS+PHP+MYSQL environment is established.

Five. Apache installation configuration (with the fourth optional)
If you do not have IIS installed, then please install Apache this small and powerful Web server, installation directory recommended and PHP directory, select C:\. The system default installation directory is C:\Program Files:
1. Download Apache2.2.4 for Win32. MSI installation file, double-click it directly and it will automatically perform Apache installation.
2. In the installation process, follow the prompts, from the top to the next blank line input localhost, the remaining two blank lines enter your first name and email address (whatever entered any line), complete the installation configuration.
After installation will be in the desktop right corner of the system tray display Apache icon, double-click can open the Apache Control Panel, you can stop or reboot the server.
Configuration of 3.apache2.2.4
Use Notepad to open C:\Program files\apache Software foundation\apache2.2\conf\httpd.conf This file for modification:
① Find:
AddType application/x-gzip. GZ tgz
Add the following lines below:
AddType application/x-httpd-php. php
AddType application/x-httpd-php. PhP4
AddType application/x-httpd-php. php3
AddType application/x-httpd-php. phtml
AddType Application/x-httpd-php-source. Phps
AddType Image/x-icon. ico
② Find:
#LoadModule Ssl_module modules/mod_ssl.so
Add a line below:
LoadModule Php5_module C:\php5\php5apache2_2.dll
(Special note: If your Apache version is 1.x, here should be: LoadModule php5_module C:\php5\ Php5apache.dll If your Apache version is 2.0.x-2.2.x, here should be: LoadModule php5_module C:\php5\php5apache2.dll, I've had a lot of trouble finding this here! )
③ Find:
DirectoryIndex index.php ...
This line, you can modify this to add the default filename:
DirectoryIndex index.php default.php index.htm index.html default.htm

Save the file and restart the Apache server. The environment for this PHP has been completely established.

Six. Zend Optimizer installation configuration (optional)
After downloading is an. exe file, directly installed on it, the installation process to choose your PHP version, you must choose accurate, here I choose php5.2.1, before the installation prompts whether to backup php.ini, the point is determined after the installation.
Open PHP.ini, modify a place:
Found it:
[Zend]
You can see the following:
zend_optimizer.optimization_level=*
This line, change the value after "=" to 1023, which means change the line to:
zend_optimizer.optimization_level=1023
After the save, restart Apache/iis, the installation is complete.

Seven. Test
Create a new file with Notepad and write the following lines:
Phpinfo ();
?>
Rename the file to phpinfo.php, save it to the C:\Apache Software Foundation\apache2.2\htdocs directory (the directory is your site root), and then enter http://localhost/phpinfo.php in the browser.
If you can see the relevant PHP information, it will prove that the entire Windows iis6/apache2.2.4+mysql5.2+php5.2.1 environment installation configuration work successfully completed!

Related Article

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.