Page 1/2 of php5.2.14 and apache2.2.16 installation and configuration methods in Windows

Source: Internet
Author: User
Tags php debug

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 http: // localhost/in the browser for verification. If the installation is successful, 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, but when PHP or HTML page, if <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"> is not included, Chinese garbled characters will appear. 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, query the keyword "default_charset", remove the semicolon, change the value to UTF-8, and restart Apache.

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.