PHP Basics: similarities and differences between PHP4 and PHP5 configurations

Source: Internet
Author: User
In the process of configuring php4 or php5, the configuration steps of php4 and 5 are roughly the same, but there are some differences in the configuration content. Compiling in LINUX and other environments. In general, the configuration is accurate as long as the compilation options are accurate. you need to pay attention to the configuration in windows.

In the process of configuring php4 or php5, the configuration steps of php4 and 5 are roughly the same, but there are some differences in the configuration content. Compile in LINUX and other environments. In general, the configuration is accurate as long as the compilation options are accurate. in windows configuration, pay attention to the following differences:

1. php4ts. dll and php5ts. dll

This file must be copied to the bin directory of apache or the system directory.

2. httpd. conf file loaded module

Example:
# For PHP4 apache1.x. xx
LoadModule php4_module d:/www/webserver/php4/sapi/php4apache. dll
AddType application/x-httpd-php. php

# For PHP4 apache2.x. xx
LoadModule php4_module d:/www/webserver/php4/sapi/php4apache2. dll
AddType application/x-httpd-php. php

# Where d:/www/webserver/php4 is the directory where php is located.

# For PHP5 apache1.x. xx
LoadModule php5_module d:/www/webserver/php5/php5apache. dll
AddType application/x-httpd-php. php

# For PHP5 apache2.x. xx
LoadModule php5_module d:/www/webserver/php5/php5apache2. dll
AddType application/x-httpd-php. php

# Where d:/www/webserver/php5 is the directory where php is located.

3. the method for loading mysql is different.

In php4 and earlier versions, mysql is integrated into php;
In PHP5 (including BETA), mysql is loaded as a module, and php. ini needs to be set for loading. for example:
Extension_dir = 'd:/www/WebServer/PHP5/ext /'
Extension = php_mysql.dll

In addition, both PHP4 and PHP5 require libmysql in the system directory. dll support. if the version is incorrect, even if you set the extension_dir and php_mysql.dll parameters accurately, the error phpp_mysql.dll cannot be found during apache startup.

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.