473,409 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Can PHP 4 and 5 coexist on a single server?

Our current webserver is a Linux Apache 2 engine running several websites
in separate virtual hosts. All of our websites were written for PHP 4,
and thus is the version of PHP running. But we are looking to host a copy
of MediaWiki which will start to require PHP 5 during the next major
release.

Since our existing sites are much to large to test and update to run under
PHP 5, I want to investigate whether we can install PHP 5 and configure
Apache to use PHP 4 for all the existings sites and use PHP 5 for the new
one.

Has anyone successfully done this, and how?

--
Justin Kennedy

May 31 '06 #1
5 2200
Sorry to intrude, Justin and all,

I am looking to do the same on an Windows XP machine.
I have PHP 4 and Apache 2.0.55 configured and running. Looking to
install PHP 5, and be able to switch b/w them, to test different code.

Sincerely,
Tariq
Justin L. Kennedy wrote:
Our current webserver is a Linux Apache 2 engine running several websites
in separate virtual hosts. All of our websites were written for PHP 4,
and thus is the version of PHP running. But we are looking to host a copy
of MediaWiki which will start to require PHP 5 during the next major
release.

Since our existing sites are much to large to test and update to run under
PHP 5, I want to investigate whether we can install PHP 5 and configure
Apache to use PHP 4 for all the existings sites and use PHP 5 for the new
one.

Has anyone successfully done this, and how?

--
Justin Kennedy


May 31 '06 #2
Taariqq wrote:
Sorry to intrude, Justin and all,

I am looking to do the same on an Windows XP machine.
I have PHP 4 and Apache 2.0.55 configured and running. Looking to
install PHP 5, and be able to switch b/w them, to test different code.

Sincerely,
Tariq


For development purpose, it's probably easiest to run multiple
instances of Apache 2.

First, open C:\WINDOWS\system32\drivers\etc and add a couple aliases to
the loopback address, like so:

127.0.0.4 php4
127.0.0.5 php5

Now, when you type in http://php5/ the browsers goes to one address and
when you type in http://php4/ it goes to another.

Second, create two copies of httpd.conf, name them httpd.php4.conf and
httpd.php5.conf (or whatever you feel like). In each, look for the
Listen directive and change it from 80 to 127.0.0.4:80 and
127.0.0.5:80. Put in the appropriate directives for loading the PHP
modules. You will likely want to use the PHPIniDir directive to set
the locations of php.ini.

Third, if Apache 2 is set up as a service already, remove it. Open a
command prompt window, cd to the Apache 2 bin folder, and enter "apache
-k uninstall." Then add two separate Apache services with the
following:

apache -k install -f conf/httpd.php4.conf -n "Apache 2 (PHP 4)"
apache -k install -f conf/httpd.php5.conf -n "Apache 2 (PHP 5)"

When you open up Services under Administrative tools, you'll see the
new services. Activate them. If the Apache monitor is running, restart
it. Then you'll see the two services there as well.

Finally, go to a phpinfo page at each location and verify the version
and php.ini path.
Happy coding!

Jun 1 '06 #3
Taariqq napisał(a):
Sorry to intrude, Justin and all,

I am looking to do the same on an Windows XP machine.
I have PHP 4 and Apache 2.0.55 configured and running. Looking to
install PHP 5, and be able to switch b/w them, to test different code.


This feature is present in WAMP serwer.

--
Pozdrawiam,
Sawi
Jun 2 '06 #4
> Since our existing sites are much to large to test and update to run under
PHP 5, I want to investigate whether we can install PHP 5 and configure
Apache to use PHP 4 for all the existings sites and use PHP 5 for the new
one.

Has anyone successfully done this, and how?


Yes, you can do that. You have to setup different application types in
the Apache conf, and then you can map the php suffix to any of them.
This can be done on a per-directory base using .htaccess (will be
propagated to all directories underneath as well).

HTH-!

Jun 2 '06 #5
Metin Savignano <ms***@zipfly.de> wrote:
Yes, you can do that. You have to setup different application types in
the Apache conf, and then you can map the php suffix to any of them.
This can be done on a per-directory base using .htaccess (will be
propagated to all directories underneath as well).


When installing PHP 5, are there precautions to make sure it won't
overwrite files from PHP 4?

--
Justin Kennedy

Jun 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: M VanTine | last post by:
Hi, I currently have VS6 on my machine (Win2000 Advanced Server). Can I install VS.net 2003 on the same machine and keep both? I am a developer and need both. Please advise what I need to do...
4
by: John Baker | last post by:
I was installing the 30-day trial version of Delphi 7, and I got a message that it wanted to change a registry key concerning Just-In-Time Debugging that currently indicates Visual Studio. Can...
9
by: Greg Gursky | last post by:
Hello: I'm doing some planning on a potential project with which I need some help. The database at the focus of this question is a MS Access database that is currently accessed by DAO from a...
1
by: Harry Simpson | last post by:
My app only produces reports when it is the only instance of Crystal Reports on the server. Otherwise I get the KeycodeV2.dll error - can't find etc. Remove the other CR engined app and...
6
by: JJ | last post by:
Hi, I am wondering can I run asp.net 1.1 web apps and asp.net 2.0 web apps on the same box? If possible how does the web server realize what framework to use when calling up a particular web...
4
by: | last post by:
I have used my first aspx page on our site to utitlize the Ad Rotator component. However, I note that my traditional asp 3.0 code generations compilation errros (eg Let and Set not allowed in...
1
by: whon | last post by:
Hi all, I am doing a little e-catalog thing that will show thumbnail of pictures on the screen, when users click on the thunbnail or drag the thumbnail to a bigger picturebox(let's give it the...
1
by: Danny Ni | last post by:
Hi, Is there anyway for a VS 2005 ASP.Net web application and a VS 2003 ASP.Net Web application and Classic ASP coexist in a web sever? If yes, please provide some info on how to make this...
11
by: Michael A. Covington | last post by:
Can VS 2005 and 2008 coexist on the same computer, with some projects continuing to be worked on in each?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.