The Core

Why We Are Here => Web Development => Topic started by: Torben on June 07, 2012, 11:06:04 AM

Title: Can you fake the PHP version in phpinfo() ?
Post by: Torben on June 07, 2012, 11:06:04 AM
I'm fighting a first level supporter about php version on a shared host. He says the server is running php 5.3. However, phpinfo says 5.2.17 and a small piece of 5.3 code fails so I'm pretty sure that they are not running 5.3.

So now the supporter says that the server is running php 5.3 even though phpinfo() says 5.2.17. Is it even possible to override the php version shown in phpinfo ?



Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: jetboy on June 07, 2012, 05:56:32 PM
Anything's possible, but not from a straight phpinfo() call as far as I know. Could it be misconfigured? E.g. Both the Apache module and the CGI version of PHP installed, slightly different versions? No idea whether this is possible, but it could explain why you're seeing one version on a web request, and checking from the shell shows another (if this is how they're checking).
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: thesaintv12 on June 07, 2012, 08:35:06 PM
Would it be possible to override the function on that server?  Frankly I don't know much about php, but in some languages it would be possible to add/modify some code wouldn't it?
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: Chunkford on June 07, 2012, 09:05:13 PM
I have a niggling urge to say restart the server.
If anything that normally fixes most electrical things in life :)
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: littleman on June 07, 2012, 11:59:56 PM
Quote
Could it be misconfigured? E.g. Both the Apache module and the CGI version of PHP installed, slightly different versions?

If you have access try shelling in and running the  phpinfo() script via command line and see if you get a different version number.
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: ukgimp on June 08, 2012, 06:45:07 AM
Can't you do

#php -v

From the command line

I cant see why they would lie, sounds like incompetence as Rowan suggested.
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: Torben on June 08, 2012, 07:06:18 AM
It's a cheap shared host so there is not access to shell or any other fancy stuff. The first level supporter has forwarded my case to someone less incompetent so I'm sure that they will fix the problem.

Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: Rooftop on June 08, 2012, 09:48:40 AM
Sounds like you're being bullshitted to me. Whether it is possible or not isn't that important. Why on earth would anyone go to lengths to deliberately do that?  If they didn't that means either 1. PHP is configured wrong and they should fix it, or 2. They are lying and should stop. 
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: Torben on June 08, 2012, 11:53:17 AM
I called their bluff and the supreme idiot of their support team admitted that they had made a mistake.
Title: Re: Can you fake the PHP version in phpinfo() ?
Post by: ukgimp on June 08, 2012, 02:46:29 PM
Lol

If I could like a post, that one would get one Torben. :-)