Help - Search - Members - Calendar
Full Version: When is PHP 5 coming?
Invision Power Services > Community Forums > Community Web Design and Coding
Arkitus
Hi,

I was learning a bit of PHP today, where I encountered a couple of new features in PHP 5 that could make my life a lot easier. I noticed that my hosting does not include PHP 5, nor does media temple or invision hosting.

I was just wondering when you think PHP 5 will become standard, and coding for it worthwhile.

Thanks,

Ali
.Logan
Hopefully soon, there is definitely a lot of features to make things easier.
Stephen
several years in my opinion
Stewart
QUOTE(Stephen @ Jun 9 2005, 10:17 PM) *
several years in my opinion


I don't think it will be several years, but I think we are still at least a year away.
Sebastian Mares
I think it will become standard when PHP 6 is out. tongue.gif
Phil Mossop
If I had to bet, I'd say it would be a year. So maybe this time next year it'll be the standard version. That's just based on my own estimation though. biggrin.gif
Arkitus
Ok, so that means I should stick to the PHP4 version of my code until next year, and no, my hosting isn't crap. biggrin.gif
Rikki
I would make anything you code now work on both PHP4 and 5. You might as well - it'd be daft writing PHP4 code now and having to fix it at some point in the future wink.gif
Brendon Koz
The largest problem I foresee with most hosting providers switching over to PHP5 are two-fold.

1.) MySQL support is no longer standard, you have to build something extra (oh no!).
2.) It will break some PHP3/PHP4 scripts which are used by both Fantastico and CPanel. I don't think hosting providers will really want to provide PHP5 until CPanel fully supports it.

There are some hosts which host BOTH PHP4 and PHP5, but you have to request that you use the PHP5 server - they do not mix the two servers...it'd be too much scripting (a file at best?) to auto-switch people from PHP4 to PHP5 permissions for the same server.

Alas, I highly doubt it'll happen fully for a few years, just like Stephen stated...however, I gave a few more reasons. original.gif Yes, it is technically easier than hosts might think, but it would add a serious headache for them that they really could care less about (i.e.: wouldn't want).
Frankl.in
My host offers both 4 and 5 at the same time for all accounts by default. If your script ends with '.php' PHP4 will be used, but if it ends with '.php5' PHP5 will be used original.gif
princetontiger
I think MySQL 4.1 will become mainstream before PHP 5 goes the same route... which is still a year away.

Early 2006 will probably see PHP 5 the version of choice. One of the handiest features is the float argument in microtime...
Danny
QUOTE(Franklin @ Jun 9 2005, 09:17 PM) *
My host offers both 4 and 5 at the same time for all accounts by default. If your script ends with '.php' PHP4 will be used, but if it ends with '.php5' PHP5 will be used original.gif
oooo... I like that idea! I should request my host do that. biggrin.gif
Arkitus
QUOTE(Rikki @ Jun 10 2005, 03:45 AM) *
I would make anything you code now work on both PHP4 and 5. You might as well - it'd be daft writing PHP4 code now and having to fix it at some point in the future wink.gif


Yeah, Im just trying to parse XML with PHP, and 5 does it much easier. The older version will still work with 5 too...I think...
princetontiger
You can take use of a cool new MySQL extension if you have both MySQL 4.1 and PHP 5 installed. "mysqli"
Wombat
QUOTE(Transverse Styles @ Jun 10 2005, 03:21 PM) *
You can take use of a cool new MySQL extension if you have both MySQL 4.1 and PHP 5 installed. "mysqli"


Admittedly the new object-oriented interface is A LOT nicer, but I can't for the life of me understand the benefit of prepared statements in a PHP script. blink.gif
DonWilson
I've been developing applications on PHP 5 ever since it came out. I hate this "maybe we'll change one day" take on upgrading to php 5. I'd rather developer for what's out now rather than sit around and be told when it's "okay" to program in PHP 5.
Stephen
QUOTE(DonWilson @ Jun 10 2005, 05:02 PM) *
I've been developing applications on PHP 5 ever since it came out. I hate this "maybe we'll change one day" take on upgrading to php 5. I'd rather developer for what's out now rather than sit around and be told when it's "okay" to program in PHP 5.


Good for you, real world applications how ever do not work like that if they want to meet their largest possible audience.
Dan C
I'd really like to see PHP5 in mainstream use, but it takes the industry a long time to adapt to new things like this. sad.gif

I personally tend to develop in php5 mode and optimize for that, then 'downgrade' the script to php4 for release usage. Though anything I do is usually made available first in the php5 version. original.gif
Vlad#
I like my host... It lets me run PHP5 scripts if I wanted it to... It allows me to run .NET scripts on Apache in Linux... It allows me to run Zope through a local directory in Apache using a proxy...


What is my host? tongue.gif

I think that if I finally get around to doing some more PHP scripting I will be doing it in PHP5, not because I don't intend to tackle the largest market variety, but because I probably won't finish it in half a year...
DonWilson
QUOTE(Stephen @ Jun 10 2005, 12:04 PM) *
Good for you, real world applications how ever do not work like that if they want to meet their largest possible audience.

Which is why I stay away from developing "real world applications", or products. I'd much rather have a great site with the most functionality designed for one server rather than the least amount of features designed for multiple servers.


QUOTE(Mireno @ Jun 10 2005, 12:34 PM) *
What is my host? tongue.gif

Are you going to answer that? I'm interested in seeing such functionality. tongue.gif
Vlad#
Virtual Private Servers are great thumbsup.gif
DonWilson
QUOTE(Mireno @ Jun 10 2005, 01:22 PM) *
Virtual Private Servers are great thumbsup.gif

Again I ask, who are you hosted by?
princetontiger
laughing.gif

Sounds like he is hiding something. Would be nice, though. fear.gif
Arkitus
yeah! I want to know too.
Barn
If it's a VPS, he's virtually his own host. wink.gif
Wombat
QUOTE(Franklin @ Jun 10 2005, 03:17 AM) *
My host offers both 4 and 5 at the same time for all accounts by default. If your script ends with '.php' PHP4 will be used, but if it ends with '.php5' PHP5 will be used original.gif


Unfortunately that probably means one is running as an Apache module and one is running as CGI - probably PHP5, not the best solution to be honest! ermm.gif

The only solutions I've seen so far for running PHP4 and PHP5 on the same server at the same time involve either running one as CGI or using multiple instances of the Apache server (i.e. with a different port number).

Neither solution is ideal in a production environment. The former isn't even suitable in a development environment IMHO.
Motley
QUOTE(Barn @ Jun 10 2005, 06:37 PM) *
If it's a VPS, he's virtually his own host. wink.gif

Exactly what I was gonna say biggrin.gif

EDIT: Fixed typo
DonWilson
QUOTE(Barn @ Jun 10 2005, 05:37 PM) *
If it's a VPS, he's virtually his own host. wink.gif

And who is providing the power, bandwidth, server, etc? tongue.gif
Kilroy-was-here
Beginning of 2006 most hosts should support it, I think.
Frankl.in
QUOTE(Wombat @ Jun 11 2005, 05:55 PM) *
Unfortunately that probably means one is running as an Apache module and one is running as CGI - probably PHP5, not the best solution to be honest! ermm.gif

The only solutions I've seen so far for running PHP4 and PHP5 on the same server at the same time involve either running one as CGI or using multiple instances of the Apache server (i.e. with a different port number).

Neither solution is ideal in a production environment. The former isn't even suitable in a development environment IMHO.

PHP4 is running as CGI and PHP5 as Apache module, at least that's what phpinfo() is telling me.

Could you explain why it is not the best solution?
Wombat
QUOTE(Franklin @ Jun 11 2005, 09:40 PM) *
PHP4 is running as CGI and PHP5 as Apache module, at least that's what phpinfo() is telling me.

Could you explain why it is not the best solution?


Well, AFAIK it is the best solution to this particular problem. But running PHP as CGI has some downsides, mainly performance and security. PHP does a lot to prevent a number of inherent possible attacks, but if using PHP as a server module is available, it should be used.

[PHP.net] Chapter 24. Installed as CGI Binary - more information.
Stephen
QUOTE(DonWilson @ Jun 11 2005, 06:29 PM) *
And who is providing the power, bandwidth, server, etc? tongue.gif


Does that really matter? he is using Virtual Private Hosting so you just need a host which provides that and you can set it up yourself. Besides Mireno is respecting the forum rules by not advertising other hosting services.
Frankl.in
QUOTE(Wombat @ Jun 11 2005, 10:54 PM) *
Well, AFAIK it is the best solution to this particular problem. But running PHP as CGI has some downsides, mainly performance and security. PHP does a lot to prevent a number of inherent possible attacks, but if using PHP as a server module is available, it should be used.

[PHP.net] Chapter 24. Installed as CGI Binary - more information.


I see. The two 'possible attacks' they mention there didn't work, so I guess it's pretty secure?
Wombat
QUOTE(Franklin @ Jun 11 2005, 10:47 PM) *
I see. The two 'possible attacks' they mention there didn't work, so I guess it's pretty secure?


If set up correctly, it should be. ermm.gif
Frankl.in
QUOTE(Wombat @ Jun 12 2005, 12:02 AM) *
If set up correctly, it should be. ermm.gif

I hope so.. tongue.gif
.Reko
I'd never use PHP as CGI with the option of an Apache module. Keep in mind too that PHP as Apache module is much better integrated with apache, so you can do stuff that PHP as CGI can't.
Frankl.in
QUOTE(uranusalien @ Jun 12 2005, 12:55 AM) *
I'd never use PHP as CGI with the option of an Apache module. Keep in mind too that PHP as Apache module is much better integrated with apache, so you can do stuff that PHP as CGI can't.

Like what?
Dan C
When running PHP as an Apache module, you can use php_value in htaccess files to set php.ini (i think) values...

Aside from that, i have no idea. original.gif
DonWilson
QUOTE(Stephen @ Jun 11 2005, 04:08 PM) *
Does that really matter? he is using Virtual Private Hosting so you just need a host which provides that and you can set it up yourself. Besides Mireno is respecting the forum rules by not advertising other hosting services.

He was repping it up as if it was the best, and after numerous questioning he still doesn't answer. I guess it doesn't really matter.
Michael_C
QUOTE(Transverse Styles @ Jun 11 2005, 02:21 AM) *
You can take use of a cool new MySQL extension if you have both MySQL 4.1 and PHP 5 installed. "mysqli"

Or you could wait for 5.1 final to roll and use PDO. :-"
Frankl.in
QUOTE(DanC @ Jun 12 2005, 01:46 AM) *
When running PHP as an Apache module, you can use php_value in htaccess files to set php.ini (i think) values...

Aside from that, i have no idea. original.gif

I'd rather use the ini_set function shifty.gif
.Reko
Which is likely to be slower.

You also can't use the virtual function, and CGI is slower, anyway. Nor can you use PHP accelerators like Turck MMCache/eAccelerator.

PATH_INFO usage and mod_rewrite are a bit flakier and harder to get working around it, too.
Wombat
QUOTE(Michael_C @ Jun 12 2005, 08:47 AM) *
Or you could wait for 5.1 final to roll and use PDO. :-"


See, now PHP Data Objects are something worth waiting for! thumbsup.gif
Delphi
I run a hosting company and I love the feature set of PHP5, thus, we have it by default. Our plans cater to developers and such so it does not usually cause any problems. We do have a few clients who prefer PHP4 so we rectified this problem by creating "PHP4 Mode". We created another instance of Apache on port 8080 running PHP4. Say a user wants to have thier account in PHP4 Mode:

1. Create proxy.domain.com and point it to 127.0.0.1
2. Modify their VirtualHost in httpd.conf with the proxy_passthrough commands to proxy the HTTP request to port 8080
3. Create the normal virtual host in the port 8080 instance of Apache.

When the site is requested by the browser, say domain.com/index.php, the port 80 apache accepts the request and acts a proxy between port 8080 Apache and the web browser. The end use does not see the transition / proxy and it seems completely normal. They get PHP4 Mode as an Apache Module or they can just choose to not use the proxy and have PHP5 as an Apache Module.
Kenny Pollock
That seems like a great plan Delphi, I was thinking of replying with an idea similar to that- but you seem to have it already.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.