SoFunction
Updated on 2025-04-13

Installation and configuration methods for PHP5.2.14 and apache2.2.16 in Windows, page 2/2

Preparation conditions:

Apache 2.2.16 Installation Version (httpd-2.2.16-win32-x86-no_ssl.msi)

PHP 5.3.3 VC6 x86 Thread Safe unzipped version Zip(php-5.3.)

Mysql 5. Install or decompress the version, as long as it can start normally

First install Apache 2.2.16 to the PHPWebSite folder of D disk (personal habits) (you need to create a new folder named PHPWebSite on D disk). After the installation is completed, test whether the installation is successful, enter it in the browser.http://localhost/Enter, if It works! It means that Apache 2.2.16 is installed successfully and can be used normally! (Note: If there is an IIS server on this machine, then you should shut down the IIS server or modify the IIS port. Because Apache also uses port 80, it is recommended to change the IIS port to other ports, such as port 8090)

Then decompress the PHP 5.3.3 VC6 x86 Thread Safe compression package to the PHPWebSite directory on D disk, rename it to php, configure the php configuration file, find the -development (I use this) file or -production file in the php folder, change the suffix name of this file to, then open it, find the line extension_dir, and modify this line to extension_dir = "D:/PHPWebSite/php/ext" and remove the previous semicolon (note that there cannot be spaces in front, change the \ in the path to /, otherwise an error will occur). Open the required PHP extension, turn extension=php_bz2.dll, extension=php_fileinfo.dll, extension=php_gd2.dll, extension=php_mysql.dll,
Remove the semicolon in front of extension=php_mysqli.dll (note that there cannot be spaces in front). If you want to open other extensions, then remove the semicolon in front of other extensions and you can. At this time, the basic configuration of the PHP environment is completed.

PHP5 time difference problem
<?php echo date("Y-m-d H:i:s");?>The time difference is eight hours
Why? The PHP5 series version has added a time zone setting, which is the default Greenwich time, which is exactly 8 hours apart from the East 8th District where China is located.
There is such a line in search
; =
Remove; and change to
= PRC

Next, configure Apache 2.2.16 to associate Apache 2.2.16 with php. Find the Apache configuration file in the D:\PHPWebSite\Apache2.2\conf directory, open the configuration file, and
#LoadModule vhost_alias_module modules/mod_vhost_alias.so input:

LoadModule php5_module D:/PHPWebSite/php/php5apache2_2.dll
PHPIniDir "D:/PHPWebSite/php"
AddType application/x-httpd-php .php .phtml

Restart Apache so that it can be associated with php. (Note that Apache must be restarted every time you modify Apache or PHP configuration file)

Finally, install Mysql 5. (MySql has no relationship with PHP), so I won’t repeat it!

Notice: The environment configuration mentioned above can be configured normally under XP, Win2003, Vista, and Win7 flagship 32-bit versions. It cannot run normally on the Win7 flagship 64-bit version. The reason is still unknown and I am still a mystery! Hehehehe...^_^