PHP4 and PHP5 coexist in a system _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
PHP4 and PHP5 coexist in one system. PHP4 and PHP5 coexist in an article that the system saw elsewhere, in the past two days, I am also looking for a time to use IIS + APACHE to use different ports for the coexistence of two PHP .... then issue again
PHP4 and PHP5 coexist in a system

I have read an article from other places. I am also trying to find a time to use IIS + APACHE to use different ports in the past two days to make two PHP coexistence .... then, send it again .. read the original article.

-------------------------------------------------------------
The advantage is not mentioned much, but the disadvantage of D... is the CGI method (reference to the official article: we consider installing PHP like this suicidal. -- esayr note: E is not good? Oh, the last one is suicide)
Let's talk about the following methods:

I. This article involves the extremely software version:
Windows 2000 Professional/XP
Apache 1.3.28 FOR WIN
Microsoft Internet Server Information (IIS6)
PHP 4.3.3 (4.3.5), PHP 5.0.0 beta (5.0.0RC1)
MySQL 3.23.57 (3.23.58)


II. general steps: (2 and 3)

1. install different versions of PHP

2. install APACHE and set APACHE and PHP

3. install IIS and set PHP versions in IIS [note 1]

4. install MYSQL


3. preparations before installation:
COPY the required program to each folder. this document will follow the following directory structure. you can modify it as needed ^:


C:/httpd/Apache
C:/httpd/MySQL
C:/httpd/PHP4
C:/httpd/PHP5
C:/httpd/php-supported des
C:/httpd/phpMyAdmin
C:/httpd/tmp
C:/httpd/www

Go to the C:/WINNT/system32/drivers/etc folder (XP is C:/WINDOWS/system32/drivers/etc) and find the hosts file (no ?! @ _ @ So...: D), add

127.0.0.1 php4 # Waiter PHP 4
127.0.0.1 php5 # Waiter PHP 5


Roar... if you know ~~ Modify other names by yourself. 8D. let's continue...
Save the file...


4. install various PHP versions
Suppose you have downloaded all the required PHP versions... (where to download ?? : P find it by yourself ...)
Here we use 4.3.3 and 5.0.0-beta as an example... (I also tried 4.3.5vs5.0.0RC1. if it is different from your environment, don't blame me: (, it's similar, let's think about it );)

(I) install PHP4.3.3
① Decompress and download the file (:) everyone on earth knows)
Use php.exe, php. ini-recommended, php already mbed. lib, php4ts. dll, php4ts. lib, dll /*. * and extensions /*. * copy to C:/httpd/PHP4
③ Modify php. ini-recommended:
Extension_dir = "C:/httpd/PHP4/extensions /"
Cgi. force_redirect = 0
Save as php. ini (under C:/httpd/PHP4)

(Ii) install PHP5.0.0BETA
① Extract...
Copy php.exe, php. ini-recommended, php embedded mbed. lib, php4ts. dll, php4ts. lib, dll/*. * and extensions/*. *. * to C: httpdPHP5.
For PHP5.0.0RC1, there is no dll or extensions directory, and only ext -- is extensions
If you are a loyal user of mysql, do not forget to copy libmysql. dll. [note 2].
③ Modify php. ini-recommended:
Extension_dir = "C:/httpd/PHP5/extensions /"
Cgi. force_redirect = 0
For PHP4.0.0RC1, extension_dir = "C:/httpd/PHP5/ext /"
Save as php. ini (under C:/httpd/PHP5)


5. configure APACHE
Open C:/httpd/Apache/conf/httpd. conf and add some settings below:


ServerAdmin test @ php433
ServerName php4
ServerAlias www
DocumentRoot "C:/httpd/www"

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow, deny
Allow from all

ScriptAlias/php4/"C:/httpd/php4 /"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php4/php.exe"



ServerAdmin test @ php500
ServerName php5
DocumentRoot "C:/httpd/www"

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow, deny
Allow from all

ScriptAlias/php5/"C:/httpd/php5 /"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php5/php-cgi.exe"

6. about PHP5 And MYSQL
I won't talk much about MYSQL installation. I just installed it myself... (skip this section and have no comments? )
You can modify php. ini to load MYSQL... (sad ...)

7. test...
Start APACHE (if httpd. if the conf configuration is incorrect, an error prompt will be displayed ...), then input http: // php4 and http: // php5 in the address bar to start PHP4 and PHP5 respectively... nice? : D [note 3]
I believe this will be a good method for PHP programmers and those who want to learn PHP5 and do not want to give up PHP4. ENJOY IT!

Summary:
In fact, the idea is very simple. the CGI method is used to realize the coexistence of PHP4 and PHP5. I found a lot of information, which is the simplest and most practical. but it is only suitable for everyone to play on the machine. never do this on the server... otherwise ~ At your own risk... don't contact me.

If you have any problem with the above method, you can try other methods. here we will list some successful foreign cases:
Http://wiki.coggeshall.org/37.html
Http://www.circle.ch/blog/p1387.html
Http://www.schlitt.info/applications/blog/..._5_prallel.html

If you are interested, continue learning...


An important supplement to this scheme will be continued:

PHP4 and PHP5 coexist, and a php. ini conflict exists...
As we all know, the general practice is to copy php. ini to the system folder (C: WinNT or C: Windows). if multiple versions are installed at the same time, conflicts may occur...

In fact, if you carefully read the PHP installation documentation, you will have the following text:
Does Where c I cut to cocould the php. ini? The php. ini files is only searched in two places: 1) in your Apache installation directory (e.g. c: apacheapache) 2) in your % SYSTEMROOT % directory.

And we are using the first method... (is this officially expected ?? God knows ...)

I have succeeded in the test in the above environment... if you encounter any difficulties, you can leave a message or go to the discussion board to discuss it together.

Conclusion:
I don't know how to write tutorials or other things. I understand it myself, but it's not easy for others to understand it.
Although the process is relatively simple, it takes me a lot of time (there are two places... the information I found is incorrect, and it hurts me... (: D big A sleeps and goes to the bathroom. I am still... this is not suitable for children. delete 500 words)

The PHP5 era is getting closer and closer. let's get to know more...

-------------------------------------------------------------------------
[Note 1]:
Originally intended to write for iis... but I really don't want to install something useless on my machine (for me :(), so... the title column is left empty... sorry for some spectators...

[Note 2]:
In php5.0.0rc1, I don't know if there is a mysqli.dllin ext. is there a libmysqli. dll in the same-layer directory of php.exe? What is this? In fact, this is an official upgrade for the new MYSQL version (4.1.0 seems like...). For the new MYSQL version, you can try it... it is said that it supports some new MYSQL features.

[Note 3]:
When starting APACHE, if you see "overlap on port 80 "... don't worry, in httpd. in conf, just comment out the notes before NameVirtualHost *: 80... (This place has been difficult for me for a long time... it's strange that APACHE settings are unfamiliar. however, I have read the APACHE settings carefully this time, but I still have some gains)


Related articles
• Solution for running apache 2.2.2 + PHP5.1.4.-05-11 pm-click: 12651
• PHP5.1.3 release-05-03 pm-click: 1860
• PHP5 study notes -- Classes and Objects in PHP5-09-05 pm-click: 5776
• Upgrade PHP4.3. * to PHP5.0.0-08-09 am-click: 5136
• Comparison of php4 and php5 configurations-08-01 pm-click: 4260
• Configure APACHE2.0.50 + PHP5 + MYSQL4.0.20 + GD Library in redhat 9-07-29 am-click: 13784
• Php5 for windows installation explanation-07-14 pm-click: 13370
• Official PHP5 version released yesterday-with the PHP Research Manual-07-14 pm-click: 6069
• PHP5 created for object-oriented purposes-06-25 pm-click: 3749
• PHP5 (1)-06-25 pm for object-oriented purposes-click: 4488

Later, I saw an article by ghost elsewhere. in the past two days, I was trying to find a time to use IIS + APACHE to use different ports for the coexistence of two PHP .... then issue again...

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.