PHP version on Vox

Status
Not open for further replies.

zachjallen39

New Member
Messages
6
Reaction score
0
Points
1
I'm been trying to use mysqli on my site which has not worked. I checked the php version in my account portal and it says my php version is 5.3.27. I did some research and everywhere I can find says that all free hosting servers have been upgraded to 5.4 which is required to run mysqli. Is there a way for me to manually select the version that is run on my account? If not why is my php version under 5.4?
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
From a test PHP script...
Code:
This script is on x10hosting's server ==> Vox <==
PHP version ==> 5.4.19 <==
PHP server date and time is ==> Wed Feb 5,2014 08:13:02 CST America/Chicago <==
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
Use a PHP script - to see the installed PHP version in your account - cPanel is not the same

PHP:
<?php print "PHP version ==> " . phpversion() . " <==<br>\n"; ?>{/php]
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
The confusion here is that the version of PHP compiled for Litespeed (the web server) is different than the version that cPanel recognizes as installed.

Code:
root@vox [~]# php -v
PHP 5.3.27 (cli) (built: Nov  5 2013 18:44:28)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.4.4, Copyright (c) 2002-2013, by ionCube Ltd.

That's the CLI version, which is what cPanel recognizes as installed.

The version installed on vox is 5.4.19. (I just manually confirmed this).

You should have no problems with mysqli.
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
I've also resolved the issue with your mysqli -- it was your script.

You instantiated the variable $DBPassword, and then referenced it in the mysqli object as $DBPass.

I changed $DBPass to $DBPassword.
 

zachjallen39

New Member
Messages
6
Reaction score
0
Points
1
Thank you, it is 5.4.
I was assuming that the cpanel version is the same as the one from phpversion or phpinfo.
Thanks leafy, I thought i cehcked that last night but it was 2am lol.

What is the php version in cpanel referencing then?
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
It's referencing the CLI version of PHP.
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Minor correction, it's recognizing the version of PHP that cPanel itself is running on (parts of cPanel are written in PHP). Usually that is the same as the version accounts use, but due to litespeed they are different in this particular case; when the PHP 5.5 upgrade happens they should be back in sync again.
 

zachjallen39

New Member
Messages
6
Reaction score
0
Points
1
Thank you for the clarification, any news or estimation on when the PHP 5.5 upgrade will take place?
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Probably sometime in March, but don't take that as anything official.
 
Status
Not open for further replies.
Top