• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

PHP5 and PHP4 on Plesk8

R

rookie878

Guest
Hi, I can't seem to find a definitive answer on this subject. I have a new box with Plesk8 installed and PHP5. I have some older sites running PHP4 scripts that I would like to migrate to this box but they won't run under PHP5. I was told that it was possible to have both PHP5 and PHP4 running on Plesk8 without any problems. One suggestion was to install PHP4 as a CGI. Has anyone had any success with accomplishing this? I contacted a 3rd party PSA support company that told me that they would have to remove PHP5 and install PHP 4.4.3. If there is anyone who knows how to get both running or who can refer me to someone I can hire to do this I would be greatful. Thanks!
 
Hi!

I followed the guide published in the link above.
Of course I didn't compile the PHP5, but got it from dotdeb.org -- I have debian sarge

And when I try to open a php page, there's an error in the log saying I don't have access to /home/http please help!
 
I had the same trouble and someone suggested that you can use a .htaccess file in the root of a site to tell the server which PHP version to use even though I only had PHP5 installedx. I couldnt get this to work. Infact the people who told me that were 1and1.co.uk.
 
I fixed it

Thanks!

I fixed the problem

There were two of them:
first the home directories weren't the same as the tutorial, so I had to check and change it

But still I had a problem with the suexec and permissions of the folder I put the php-cgi program, because not only the file, but also the folder must be same user/group as the owner of the site.

After fixing these problems it works.
THANKS!
 
Re: I fixed it

Originally posted by petraki
Thanks!

I fixed the problem

There were two of them:
first the home directories weren't the same as the tutorial, so I had to check and change it

But still I had a problem with the suexec and permissions of the folder I put the php-cgi program, because not only the file, but also the folder must be same user/group as the owner of the site.

After fixing these problems it works.
THANKS!

Hello,

So your using .htaccess? what did you put in your .htaccess file?

-Samuel
 
Re: Re: I fixed it

Originally posted by PCSupportGuys
Hello,

So your using .htaccess? what did you put in your .htaccess file?

-Samuel

Hi!

I didn't use exactly the same method.
The main difference is that I configured a new extension .php5 for the 5th version

I'll explain all the steps:
This is for the Debian
1. Added a raw in /etc/apt/sources.list saying
deb http://packages.dotdeb.org stable all
Instead of compiling myself the PHP5 I used the www.dotdeb.org version, which I believe is a good one

2. Install the php5 as cgi program with the following
apt-get update
apt-get install php5-cgi
(if you need other packages like mcrypt use 'apt-get install php5-mcrypt)

3. Optional: For myself I removed the line from the sources.list because it can break some things when doing apt-get update, because dotdeb project has new version for php4, which in my case break some sites

At this point you already have the php5-cgi program installed in /usr/bin/php5-cgi

4. In every virtual server you must do the following

a. create in the root subtree dir called php (in my example /var/www/vhosts/example.com/php)

b. give it the same owner as the owner of the file inside httpdocs
chown example:psacln php

c. copy the php5-cgi file inside the php dir and rename it to php5
cp /usr/bin/php5-cgi /var/www/vhosts/example.com/php/php5

d. here also change the owner
chown example:psacln php5

e. create vhost.conf inside /var/www/vhosts/example.com/conf containing:
ScriptAlias /php5-cgi-custom /var/www/vhosts/example.com/php
Action application/x-httpd-php5-custom "/php5-cgi-custom/php5"
AddType application/x-httpd-php5-custom .php5

This ends the configuration for the domain, don't forget to add in the Plesk configuration for the domain support for cgi (you are running the php5 as cgi program)

And one last thing which must be done server wide. In order to open index.php5 as default page when entering site without link to a page, you must add the index.php5 as possibility in
/etc/apache2/apache2.conf
under DirectoryIndex list

And to answer your question:
I didn't use .htaccess and in the explained configuration you can run (also in the same dir) php4 alongside php5, just make sure to use the .php5 when running php 5 scripts

Hope this helped you.
 
Originally posted by rookie878
Hi, I can't seem to find a definitive answer on this subject. I have a new box with Plesk8 installed and PHP5. I have some older sites running PHP4 scripts that I would like to migrate to this box but they won't run under PHP5. I was told that it was possible to have both PHP5 and PHP4 running on Plesk8 without any problems. One suggestion was to install PHP4 as a CGI. Has anyone had any success with accomplishing this? I contacted a 3rd party PSA support company that told me that they would have to remove PHP5 and install PHP 4.4.3. If there is anyone who knows how to get both running or who can refer me to someone I can hire to do this I would be greatful. Thanks!
You can install php4 as a side of php5 in Linux plesk server .
So the .php extension files will take php5 as default php and .php4″ extensions will take php4 as default php . You can also set the default php as php4 for a particular domain.

Note: Current running php is php5 in the server .So we dont touch the php5 settings

You could also able to set php4 as default php of a domain
If you wish this type of configuration please follow the link below ,

-------------
http://sherin.in/?p=30
---------------------
 
Re: Re: PHP5 and PHP4 on Plesk8

Originally posted by mastersherin
You can install php4 as a side of php5 in Linux plesk server .


Could you explain how you do that please ?

By Default I have plesk installed with PHP5 on FC and I would like to install php4 in cgi, but I don't know how to do :\
 
Re: Re: Re: PHP5 and PHP4 on Plesk8

Originally posted by Titam
Could you explain how you do that please ?

By Default I have plesk installed with PHP5 on FC and I would like to install php4 in cgi, but I don't know how to do :\
Hi!

I described earlier what you should do, in steps

Which step you don't understand/succeed?

petraki
 
Re: Re: Re: Re: PHP5 and PHP4 on Plesk8

Originally posted by petraki
Hi!

I described earlier what you should do, in steps

Which step you don't understand/succeed?

petraki

When I read, I understand you install php 5 in CGI, not PHP 4.

Actually, I don't need php 5, it's just installed by default, and I don't know how to install my php 4 in cgi with my plesk installation
 
Re: Re: Re: Re: Re: PHP5 and PHP4 on Plesk8

Originally posted by Titam
When I read, I understand you install php 5 in CGI, not PHP 4.

Actually, I don't need php 5, it's just installed by default, and I don't know how to install my php 4 in cgi with my plesk installation

If you want to install PHP4 as CGI, so both coexist, follow the same steps, but replace the word php5 with php4.
For example to install the program write
apt-get install php4-cgi
(you don't need to touch sources.list)
 
Ok, thank you :) I will try to find a source with php 4 which is ok Fedora Core 4 ..
 
And one more thing, if you like just to replace PHP5 with PHP4 and you are using debian, or debian based disto (for other it should be something similar)
find all php5 packages installed with
dpkg -l | grep php5
and remove them
install the same packages with php4

As long as I know Plesk doesn't touch the PHP installation, so if you didn't install some additional plug-in, this should be enough

Still if you don't know what are you doing don't try this, the PHP4 CGI is safer, because you don't change the existing configuration, but create something new
 
Back
Top