Gallery 2 Requiring PHP 5 in February 2008

Several of the leading PHP projects and web hosting providers are working together to push for PHP 5 adoption at GoPHP5.org. Gallery is pleased to announce that we will be joining them and committing to requiring PHP 5.2 to use versions of Gallery 2 released after February 5th, 2008.

Gallery 2.3 is currently in the works and will continue to support PHP 4.3 and security fixes will continue to be applied to Gallery 2.3.x for at least six months after our first release requiring PHP 5.2. However, if you want to use the cool new features in later releases, you should make sure that your web host supports PHP 5.2 and encourage them to upgrade if they don't! We feel that requiring PHP 5 is important for Gallery and will allow us to develop a better product for you! Read on for more details.


Some specific reasons PHP5 will let us make Gallery 2 even better:

  • Exceptions: We will no longer need to use our own complex framework for error handling because PHP5 provides support for exceptions that can be called and handled by PHP code.
  • XML and JSON Support: PHP5 provides fast, native support for reading and writing to XML and JSON which will allow us to add in fancier "Web 2.0" features without relying on third party libraries. This is good for stability and performance, as well as security.

PHP 5.2 has been chosen instead of earlier versions of PHP 5 because PHP 5.2 has shown to perform better and be significantly more stable than earlier versions.

You can read more about the advantages of PHP5 on ONLamp.net: Why PHP5 Rocks! (Notice the date this article was written!)

We are working with our certified web hosts to make sure that they meet the requirements by the target date.

This will have no effect on Gallery 1. Future releases of Gallery 1 will continue to support PHP 4.

Tim_j's picture

Yes, Gallery 1 will be supported.
But the focus of the Gallery project is definitely on Gallery 2. You may have noticed that only one developer is left in the G1 team.

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6

Hi there,

I sincerelly hope my hosting company will adopt PHP5 soon, but I doubt it. They seem to be extra conservative on migrating to new services vertions. I've actually asked them to upgrade to mysql5 and all I got is a polite no-way.

I have 7 months for the requirement and 13 for the support drop, hope is enogh for this guys, I won't sacrifice my gallery! ;)

PHP5 or a new hosting! hehe

Martin

Why are you so calm? Have you done that kinda stuff before?

The PHP language developers will drop PHP 4 support in a year too (no more security updates, same what happened to PHP 3 a long time ago). This will pretty much ensure that even the most conservative host will switch to PHP 5 by Auguest 2008, or sooner.

Valiant

What impact would this have on existing galleries if any?

Is it be painless to update to php 5?

If I update to PHP5 now will my current installation fall over and I have to wait for 2.3 before doing this?

Thanks
.
Gallery version = 2.2.2 core 1.2.0.4
PHP version = 4.3.9
Operating system = Linux (CentOS 4)
Default theme = PGtheme
Web Site: dakanji.com

> Is it be painless to update to php 5?

When it comes to Gallery, yes. Nothing changes.
Other PHP applications might need small changes when migrating from PHP 4 to PHP 5.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

Will this update help loading page faster? Cause my site load very slow, sometimes it times out and give error.

thanks.

____________________________________
My Gallery

Ibiza's picture
ckdake wrote:
PHP 5.2 has been chosen instead of earlier versions of PHP 5 because PHP 5.2 has shown to perform better and be significantly more stable than earlier versions.

The new object model of PHP 5 is quiet a progress for the development of object oriented applications. But I've read about significant performance issues with PHP5. E.g. sombody wrote in a blog that Drupal is 13% slower with PHP5. Is this problem really fixed in 5.2?
What is your experience with PHP5.2 and G2 ?
Cheers from Ibiza

_____________________________
Ibiza Foto Gallery2 v2.2.1

I agree that Gallery 2 will work much better on PHP5 but not all hosting supports PHP5 so this can be a problem for users who don't have PHP5 support. Someone tell me that websites with PHP5 work slower but I think its problem with proper configuration of the server.

Tom

@Performance:
G2 should be faster with PHP 5.2 than with PHP 4.x.
It depends on the PHP script that you're using as benchmark. But PHP 5 has matured. Earlier PHP 5 versions had some performance degradations compared to PHP 4 in some situations. But PHP 5.2 is known to performe very well and if you're using a lot of OO as G2 does, it should be faster than with PHP 4.

@Drupal:
I don't know the Drupal code-base well enough. But I know that it isn't using OO as much as G2. And AFAIK, it's using a PHP error handler by default. G2 disables the PHP error handler for PHP 5 because PHP 4 compatibility forces us to omit the "static" keyword in a lot of places which triggers thousands of error handler calls (E_STRICT warnings) per request and thus slows down G2 under PHP 5 if the handler is enabled. We can fix that issue once we drop PHP 4 compatibility.
And that might also be a reason why Drupal didn't perform that well in that benchmark. But I'd also be interested in an update of that benchmark with PHP 5.2.x.

Martiniano wrote:
Hi there,

I sincerelly hope my hosting company will adopt PHP5 soon, but I doubt it. They seem to be extra conservative on migrating to new services vertions. I've actually asked them to upgrade to mysql5 and all I got is a polite no-way.

I have 7 months for the requirement and 13 for the support drop, hope is enogh for this guys, I won't sacrifice my gallery! ;)

PHP5 or a new hosting! hehe

Martin

Why are you so calm? Have you done that kinda stuff before?

By the time this comes out, I think most hosters will have made the switch to php5.
My guess is, that most hosters will make the switch end of this year.

Mayim's picture

Wait, wait, wait, wait, wait. Let me get this straight. You're upping the system requirements for your primary project (i.e. Gallery 2, as opposed to Gallery 1), and you're talking about this like it's a GOOD thing for users?

Is this Bizarro World?

Let me explain something that you perhaps have not realized. Increasing the system requirements of a piece of software is like increasing the price of a physical product. It makes it less accessible. It makes it harder to install on many systems, and actually impossible for people in some circumstances to install (e.g. if they have an ISP who won't install PHP5)

Increasing the system requirements of a piece of software is ALWAYS A BAD THING. Now, supporting PHP5, that would be a good thing. But to require it? Congratulations, you just made it impossible to use your program on over 80% of the PHP-using market.

Great job, guys! Way to shoot yourselves in the foot!

Protip: The primary/stable version of a program should work on the most common version of the target platform. (In this case, PHP4 would be that most common version.) The "cutting edge" platform (in this case, PHP5) is okay as a target platform for the development version of a program, but it's sheer idiocy to target a cutting-edge release of PHP with a mainstream release of a mainstream Web application.

Making the current version of your software require PHP 5 is much like what would happen if Microsoft would have made Office 2007 require Vista. Office 2007 is a hard sell as it is-- it'd be a total flop if MS were stupid enough to make it require a little-adopted cutting-edge OS.

And that's the same mistake you're making. Most people still use PHP4, but you're preparing to make the current version of your program require PHP5.

This is a stupid decision.

I urge you to change your minds before you blunder your way into irrelevance.

ckdake's picture

Mayim: Please read the GoPHP5 FAQ at http://www.gophp5.org/faq . We put a lot of thought and discussion into this and it makes sense to us. Because of the number of projects and hosts committing to this, by the target deadline 80% of the market should be running PHP 5. (Note that the switch is still over 200 days away!)

Increasing system requirements has to happen sometimes, and right now it's a hassle to keep writing PHP 4 things to do thing that PHP 5 does itself. Office 2007 may not require Vista, but it does require at least Windows XP! By the time this goes into effect, PHP 6 will likely be the new "cutting edge" PHP platform.

Also, please note that Gallery 2.3 will be out relatively soon and will continue to work on PHP 4 just fine. It's not like we'll stop giving it away (or supporting it in the forums immediately or providing critical security fixes), but if people want the new feature beyond Gallery 2.3, they'll need to be able to use PHP 5. We aren't deprecating PHP support for our current product, just for a new version of the product that likely won't be released for a year!

--
http://ckdake.com/

If you found my help useful, please consider donating to Gallery.

Mayim wrote:
Wait, wait, wait, wait, wait. Let me get this straight. You're upping the system requirements for your primary project (i.e. Gallery 2, as opposed to Gallery 1), and you're talking about this like it's a GOOD thing for users?

Is this Bizarro World?

No, fortunately this is the regular old world of computers. System requirements go up, not down. This is true across the board, as time marches on requirements go up and older stuff is not supported. At some point, many projects stopped supporting PHP3. I imagine the same sort of uproar happened, but the world survived and PHP4 was better.

Miyam wrote:
Let me explain something that you perhaps have not realized. Increasing the system requirements of a piece of software is like increasing the price of a physical product. It makes it less accessible. It makes it harder to install on many systems, and actually impossible for people in some circumstances to install (e.g. if they have an ISP who won't install PHP5)

It isn't really like increasing the price of the software. Most of the "cost" is going to be on the ISPs to come up with a valid approach to moving to PHP5 (if they aren't already there). I know some already offer it and some offer it as a relatively easy change to your account. Nothing is impossible. If someone discovers a host that *refuses* to allow some way of having PHP5, customers can vote with their money and find a new host. The reason that *many* projects are supporting the push to PHP5 is to make it more compelling to the ISPs, which means there is a big stick helping to convince them to offer PHP5.

Miyam wrote:
Increasing the system requirements of a piece of software is ALWAYS A BAD THING. Now, supporting PHP5, that would be a good thing. But to require it? Congratulations, you just made it impossible to use your program on over 80% of the PHP-using market.

That isn't true either. As video games get better and better, they require better and better systems. Is that a bad thing? I don't think anyone would say that, though I'm sure some people would say it kind of sucks to have to upgrade. If you want to live with the same graphics, the same features... it is easy, just keep using the same version of the software. G2.2 and G2.3 will continue to work on PHP4 just fine, no reason to worry about it. And to offer the *entire* article you pull your stats from, check out the PHP market. It looks to me like PHP4 is on the decline (losing almost 20% in 2 years, basically rocketing down) while PHP5 is doing the opposite. Sure, they aren't on the same trajectory... but you need something to help with that, and that is what this is. It'll be the rocket boosters on PHP5 and unfortunately for PHP4, the brakes.

Miyam wrote:
Great job, guys! Way to shoot yourselves in the foot!

Protip: The primary/stable version of a program should work on the most common version of the target platform. (In this case, PHP4 would be that most common version.) The "cutting edge" platform (in this case, PHP5) is okay as a target platform for the development version of a program, but it's sheer idiocy to target a cutting-edge release of PHP with a mainstream release of a mainstream Web application.

Excellent point and I have heard the Gallery 2 developers discussing the support of the primary target (80%!) many times. So look at it this way: G2.3 is currently in early development, with no projected release date. It is fairly typical that it takes 6 months or more for these things to come out, so chances are it will come out around or after the target date. That means PHP4 support still going along just fine until the *next* version comes out, which could be 6 months or more. In 1 year, would you still expect that PHP4 is the 80% and PHP5 is the 20%? I doubt it.\

Miyam wrote:
Making the current version of your software require PHP 5 is much like what would happen if Microsoft would have made Office 2007 require Vista. Office 2007 is a hard sell as it is-- it'd be a total flop if MS were stupid enough to make it require a little-adopted cutting-edge OS.

What, you mean like DX10 requiring Vista? Like Halo 3 requiring Vista? Your comparison is a wee bit off, because PHP5 has been our for 2+ years now I believe. It'd be a little more like requiring XP with Office 2007, well except the time between those is a bit more than 2 years.

Miyam wrote:
And that's the same mistake you're making. Most people still use PHP4, but you're preparing to make the current version of your program require PHP5.

This is a stupid decision.

I urge you to change your minds before you blunder your way into irrelevance.

Since most people will still be using PHP4, that is why G2.3 is going to be totally happy with PHP4. That is also why security updates are going to be provided for G2.3 after G2.4 comes out and is PHP5 only. What happens when PHP4 stops getting security updates? At some point, a movement to PHP5 has to happen. Wouldn't it be better to do it while ISPs can still reliably offer *both*?

I personally doubt this will cause gallery to blunder its way into irrelevance.
_________________________________
Support & Documentation || Donate to Gallery || My Website