Coexistence of Apache-based PHP4 and PHP5 in Windws

Source: Internet
Author: User
Tags file upload
PHP4 and PHP5 may be used at the same time during PHP learning. There are also many installation methods on the Internet for the coexistence of the two, mostly installed under IIS and Apache. The following describes my installation method. I think it is more optimized and easy to upgrade.

For ease of introduction, first introduce my installation environment: Windows XP Pro SP2, Apache 2.0.55, PHP4.4.1, PHP5.1.1, all installed in D :( That is, the d area has the following folder D: apache2, d: php4, d: php5), configure two IP addresses 192.168.0.2 and 192.168.0.3 for the network adapter (this article does not focus on how to configure multiple IP addresses ). The modular installation method of Apache is introduced as an example below:
1. Install and configure the Apache 2.0.55 server. After you agree to the license agreement, the server information page will be displayed for local debugging. The first two inputs are localhost. Edit the httpd. conf file and locate ServerName localhost: 80 and Listen 80 respectively. Add # in front to close the settings.
2. Prepare PHP. Extract the downloaded php package (for example, php-5.1.1-win32.zip) and place it to d: php4 and d: php5.
3. Configure php. ini respectively. Because there are two versions of PHP, you need to configure them separately. Copy a copy of php. ini-recommended and rename it as php. in.
Digress: the obsolete method should be processed in this way. Copy php. ini file to x: winnt (x: windows) or apache installation folder, and copy x: phpphp5ts. dll, php4ts. dll and other dll files to the winnt (windows), winntsystem32, or apache installation folder. I strongly recommend that you do not do this. It will be difficult to upgrade later. The reasons are as follows.
4. Modify the windows path variable. Join
D: php4; d: php5
Go to the path environment variable to tell the system where to find php5ts. dll and other dynamic link library files, so we do not need to copy these dll files to % windir %, so it is much easier to upgrade PHP, so we do not need to delete the original files one by one. You can view how to modify the path here.
5. Modify php. ini respectively. Modify extension_dir and extension_dir. Find the above variables in php. ini and add the appropriate path. I modified it like this in php. ini of PHP4.
Extension_dir = "D: php4extensions"
And
Include_path = "d: php4pear; d: php4shortdes"
Php. ini in PHP5
Extension_dir = D: php5ext
And
Include_path = "D: php5PEAR; D: php5"
In fact, php needs to be modified. many other parameter values in ini, such as the file upload temporary path, Session temporary path, mail setting, and extension module configuration (in PHP5, to support mysql, remove the number in the following code)
; Extension = php_mysql.dll
However, because it is not the focus of this article, we will not detail it in detail.
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.