PHP4 or PHP5

9 posts / 0 new
Last post
#1 Tue, 05/29/2007 - 15:37
ah...lifes...good

PHP4 or PHP5

Hello experienced server administrators,

When setting the default PHP version on] System Settings] Server Template, what is the recommended PHP version?

Should I choose the lowest version available or PHP 5?

I should that that PHP 5 will be backward compatible to all earlier versions? Is there any reason why we should choose the lowest version available?

Thanks in advance.

Tue, 05/29/2007 - 18:14
Joe
Joe's picture

Howdy A,

PHP 5 is not backward compatible (though it's not willfully incompatible...scripts written for PHP 4 do generally need modification to run on PHP 5). But, if you don't know you need PHP 4, go for PHP 5. It's got a higher number, so it's got to be better, right? ;-)

Install Scripts should automatically configure the right version, regardless of the default PHP version.

If you find that you do need to install something that only runs under PHP 4, you can change all of the filenames to *.php4 and force them to use PHP 4 (or switch to PHP 4 for that domain, depending on whether you've already got scripts that require PHP 5).

It's a pretty complicated thing, and I'm not particularly impressed with the lack of backward compatibility in PHP (the move from PHP 3 to PHP 4 broke a bunch of stuff, too, and the move to PHP 6 is expected to do the same). At some point, a language needs to stabilize and provide a clean forward path. Perl got this right years, and years, and years ago, and even Perl 6 (which is probably the most dramatic mainstream language update ever) will run unaltered Perl 5 code. It's more work for the language developers, but it saves far more work for the thousands of developers relying on the language to not have it shift underneath their feet. I'll stop ranting now. ;-)

In short, it doesn't really matter, unless you're developing your own apps. Choose the one that your favorite scripts run on, but if they run on both, choose PHP 5.

--

Check out the forum guidelines!

Tue, 05/29/2007 - 18:43
ah...lifes...good

Thanks Joe for the enlightenment. I am stunned (because I am ignorant of the fact) that PHP 5 isn't backward compatible!

I suppose all the existing scripts that we use on our websites require PHP 4. Whether they will run on PHP 5 is a big question mark, which I have to investigate further.

Thanks for the speedy caution! You saved me a lot of headache down the road!

Fri, 08/10/2007 - 08:53
RonCooper

sorry wrong thread...<br><br>Post edited by: RonCooper, at: 2007/08/10 09:16

Fri, 09/07/2007 - 10:09 (Reply to #4)
gulmezt

Hello joe

I am using CentOS 5.0 and I am trying to install ez CMS platform for one of my client and I need php4.4 doesnt work with php4.3 or php5 it is a bit annoying .If you have any solution for me i would appreciate .Thank you very much joe.

Kind regards

Fri, 09/07/2007 - 10:21 (Reply to #5)
Joe
Joe's picture

Our CentOS 5 php4 package is 4.4.7. Just install it and switch to it for that virtual server. No big deal.

[code:1]
yum install php4 php4-domxml php4-xmlrpc php4-domxml php4-gd php4-mysql php4-postgresql php4-snmp php4-imap php4-mbstring php4-odbc php4-ncurses
[/code:1]

Then browse to the Website Options for that virtual server, and tell it to use PHP4 as the default PHP version.

--

Check out the forum guidelines!

Fri, 09/07/2007 - 10:41 (Reply to #6)
gulmezt

Thank you very much

I am going to try now.

Fri, 09/07/2007 - 02:52
gulmezt

Hello joe
I purchased virtualmin pro almost a month ago i didnt have time to play around .I just wonder I really need to use php4.4 i know it is possible to switch between php5 and php4 bu i need php4.4 if it works together Could you explain me how to do .Thank you very much

b]AH wrote:[/b]
<div class='quote'>Hello experienced server administrators,

When setting the default PHP version on] System Settings] Server Template, what is the recommended PHP version?

Should I choose the lowest version available or PHP 5?

I should that that PHP 5 will be backward compatible to all earlier versions? Is there any reason why we should choose the lowest version available?

Thanks in advance.</div>

Fri, 09/07/2007 - 10:02 (Reply to #8)
Joe
Joe's picture

Howdy gulmezt,

I'm not sure what you mean...you're saying you specifically need PHP 4.4 and not just any PHP 4.x revision? Or, are you asking how to switch between PHP 4 and PHP 5?

Depending on your OS, you may or may not have PHP 4.4 (but you'll certainly have some version of PHP4 available, because I've provided packages for all of our supported platforms, of the OS doesn't provide it). What OS are you using?

--

Check out the forum guidelines!

Topic locked