For installation and configuration of PHP5.2.14 and apache2.2.16 in windows, if you need to configure the php runtime environment, refer.
For installation and configuration of PHP5.2.14 and apache2.2.16 in windows, if you need to configure the php runtime environment, refer.
First download the configuration file to be installed
1. apache-2.2.16
2. php-5.2.14-Win32
1. apache configuration
If you do not want to install apache, select the desired location during the installation process and click next. Port 80 by default. After the installation is complete, enter the browser for verification. If the installation succeeds, It works will be output!
Apache configuration: the configuration file is located in % APACHE_HOME % \ conf \ httpd. conf under the installation directory. Modify the root directory DocumentRoot (two in total ). The port is also modified here.
Ii. php configuration
Decompress the downloaded php-5.2.14-win32.zip file. Do not download php debug or none-thread-safe. Otherwise, an error occurs when combined with apache.
Copy the extracted php. ini-dist and back it up. Rename the original php. ini-dist as php. ini, open the file, and configure it.
1. Set the extension location:Extension_dir = "% PHP_HOME %/ext"(After modification, enable this setting to remove the semicolon, and % PHP_HOME % is the php decompression directory)
2. Open the needed extension:Extension = php_bz2.dll, extension = php_gd2.dll, extension = php_mysql.dll, extension = php_mysqli.dllRemove the semicolon (note that there is no space in front). If you want to enable other extensions, remove the semicolon before other extensions.
3. Time Difference Problem: Search
; Date. timezone =
Change
Date. timezone = PRC
4. Integration of configuration with apache
Open the apache configuration file httpd. conf and go
# LoadModule vhost_alias_module modules/mod_vhost_alias.so
Enter the following information for this line:
LoadModule php5_module E:/php/php-5.2.14-Win32/php5apache2_2.dll
PHPIniDir "E:/php/php-5.2.14-Win32"
AddType application/x-httpd-php. php. phtml
Explanation:
The first behavior is to combine php and apache to use the dynamic link library location, which is in the root directory after php decompression.
The second behavior is the path of the php. ini file.
The third line is to tell the browser to forward the. php. phtml file to apache for parsing.
Restart Apache to associate it with php. (Note that Apache must be restarted every time you modify the Apache or PHP configuration file)
Garbled characters should be encountered and should be added when encountered.
PS: I used Eclipse for PHP Developers for development. In the preference, the workspace encoding is set to UTF-8 by default. However, if the encoding is not included in the php or html page , Hong Kong Server rental, then there will be Chinese garbled characters. Check that the encoding of the garbled file is UTF-8 and must be saved as UTF-8 again. The garbled file disappears. This should be a problem with bom (Byte Order Mark. Current solution: Open the php. ini file and query the keyword "default_charset", virtual host, and virtual host. Remove the semicolon, change the value to UTF-8, and restart apache.