Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
Author « Topic »  

quantum503
Advanced Member

United Kingdom
230 Posts

Pre-sales questions only
(More Details...)

Posted - 02/07/2017 :  10:51:08  
Hi

I'm want to upgrade my PHP version to 7.1, so I've tried to run the store updater 6.6.1 and everything seems to work OK while PHP is 5.6. I got the confirmation that everything had been successfully updated to 6.6.1, although the admin section still said 6.5.5 (which I didn't understand).

But as soon as I switch to PHP 7.1 I get the following on the home page:
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/****/public_html/vsadmin/inc/languagefile.php:10

and the control panel gives me:
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/****/public_html/vsadmin/inc/incfunctions.php:2174 Stack trace: #0 /home/****/public_html/vsadmin/inc/incfunctions.php(56): ect_query('SELECT adminEma...') #1 /home/****/public_html/vsadmin/inc/incloginfunctions.php(13): getadminsettings() #2 /home/****/public_html/vsadmin/login.php(18): include('/home/****...') #3 {main} thrown in /home/****/public_html/vsadmin/inc/incfunctions.php on line 2174

Any idea what has gone wrong?

Thanks
Eric Lewis

Andy
ECT Moderator

95440 Posts

Posted - 02/07/2017 :  11:00:05  
Hi Eric

If the admin is showing 6.5.5 it means that the updatestore.php file wasn't run successfully so can you make sure that is done and you get a success message?

Andy

Please feel free to review / rate our software

quantum503
Advanced Member

United Kingdom
230 Posts

Pre-sales questions only
(More Details...)

Posted - 02/07/2017 :  11:36:35  
Hi Andy

I did get the 'everything successfully updated' message when I was using PHP 5.6. I tried running it again now that the server is on PHP 7.1 and got this:

Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/****/public_html/updatestore.php:55 Stack trace: #0 /home/****/public_html/updatestore.php(3586): ect_query('SELECT payProvE...') #1 {main} thrown in /home/****/public_html/updatestore.php on line 55

Eric Lewis

Andy
ECT Moderator

95440 Posts

Posted - 02/07/2017 :  12:12:01  
Can you make sure your db_conn_open.php uses the following format (with your username, password etc)

<?php

// You host should be able to provide you with these settings if you do not know them already

$db_username = "YourUserName"; // Your database login username
$db_password = "Yourpassword"; // Your database login password
$db_name = "yourdatabasename"; // The name of the database you wish to use
$db_host = "location of database"; // The address of the database. Often this is localhost, but may be for example db.yoursite.com

//////////////////////////////////////////////////
// Please do not edit anything below this line. //
//////////////////////////////////////////////////

$GLOBALS['ectdatabase'] = new mysqli($db_host, $db_username, $db_password, $db_name);
if(mysqli_connect_error()){
ob_clean();
print '<html><head><title>Database connect error</title></head><body><div style="margin:20px;clear:both">Database Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() . '</div>';
print('<div style="margin:20px;clear:both">You need to set your database connection in vsadmin/db_conn_open.php</div>');
print '<div style="margin:20px;clear:both">For help setting your database connection please see...<br />';
print '<a href="https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn" target="_blank">https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn</a></div>';
print '<div style="margin:20px;clear:both">We also have a support forum here...<br />';
print '<a href="https://www.ecommercetemplates.com/support/" target="_blank">https://www.ecommercetemplates.com/support/</a></div>';
die('</body></html>');
}
?>

Andy

Please feel free to review / rate our software

quantum503
Advanced Member

United Kingdom
230 Posts

Pre-sales questions only
(More Details...)

Posted - 02/08/2017 :  02:45:11  
Hi Andy

Yes, I'm using that.

Eric

Andy
ECT Moderator

95440 Posts

Posted - 02/08/2017 :  03:03:48  
That should be fine then. I'll check with Vince for you. Line 55 is

return(@$GLOBALS['ectdatabase']?$GLOBALS['ectdatabase']->query($ectsql):mysql_query($ectsql));

and I'm not sure why that's throwing an error for you.

Andy

Please feel free to review / rate our software

Vince
Administrator

42874 Posts

Posted - 02/08/2017 :  03:10:26  
Hi Eric
Can you post here what you have in the db_conn_open.php file then? (Except for the username, password, db_host and db_name). All I really want to see is what you have below the line...
// Please do not edit anything below this line. //

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

quantum503
Advanced Member

United Kingdom
230 Posts

Pre-sales questions only
(More Details...)

Posted - 02/08/2017 :  04:58:28  
Hi Vince

Here it is:

$GLOBALS['ectdatabase'] = new mysqli($db_host, $db_username, $db_password, $db_name);
if(mysqli_connect_error()){
ob_clean();
print '<html><head><title>Database connect error</title></head><body><div style="margin:20px;clear:both">Database Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() . '</div>';
print('<div style="margin:20px;clear:both">You need to set your database connection in vsadmin/db_conn_open.php</div>');
print '<div style="margin:20px;clear:both">For help setting your database connection please see...<br />';
print '<a href="https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn" target="_blank">https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn</a></div>';
print '<div style="margin:20px;clear:both">We also have a support forum here...<br />';
print '<a href="https://www.ecommercetemplates.com/support/" target="_blank">https://www.ecommercetemplates.com/support/</a></div>';
die('</body></html>');
}
?>

</SCRIPT>

Thanks

Eric Lewis

Vince
Administrator

42874 Posts

Posted - 02/08/2017 :  05:05:03  
Hi Eric
In that case it may be that for some reason the PHP 7.1 setup is failing to connect to the database. Can you send the site FTP login details to my email (vince AT ecommercetemplates DOT com) and I'll look into this a bit more for you.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Vince
Administrator

42874 Posts

Posted - 02/08/2017 :  11:00:39  
Hi Eric
I see what the problem is. In PHP 7.0 and above you can only have tags like this...
<?php
// PHP Code
?>
...around PHP code. We've updated all our templates that used the old...
<script language="php">
// PHP Code
</script>
...system but your database connection file still had those old tags. I've changed them and everything should work properly now.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

quantum503
Advanced Member

United Kingdom
230 Posts

Pre-sales questions only
(More Details...)

Posted - 02/09/2017 :  02:19:02  
Vince

Does that mean I should run the updater again for other sites that will be migrated to PHP 7.1?

Eric Lewis

Andy
ECT Moderator

95440 Posts

Posted - 02/09/2017 :  02:41:16  
Yes, sites will need to be running a minimum of ECT v6.6 to use PHP 7

Andy

Please feel free to review / rate our software

quantum503
Advanced Member

United Kingdom
230 Posts

Pre-sales questions only
(More Details...)

Posted - 02/09/2017 :  04:44:13  
Thanks guys

First class help as always.

Eric Lewis

ITZAP
Ecommerce Template Guru

Australia
1018 Posts

Posted - 02/09/2017 :  06:55:37  
But would you actually recommend running PHP 7.1 Vince ?
Any distinct advantage in that ?
Or should we leave well enough alone and remain on PHP 5.6 ?

Gary

Vince
Administrator

42874 Posts

Posted - 02/10/2017 :  08:24:10  
Well, it is supposed to be a lot faster. But saying that speed was never really an issue with PHP 5.x. We've got stores now running on PHP 7.1 and it doesn't seem to cause a problem. I would say really that I don't see compelling reasons either way.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

seventh-gear
Advanced Member

USA
116 Posts

Pre-sales questions only
(More Details...)

Posted - 01/24/2019 :  17:05:13  
Hi,

My host finally stopped providing support for PHP 5.6 so today I switched to PHP 7.2, and I am having this same problem. I'm current with ECT v7.0.3.

Unfortunately I guess I'm not understanding the solution explained. I tried modifying db_conn_open.php the way I thought was explained, but it just generated another error:

Call to undefined function mysql_connect() in /homepages/43/d162641710/htdocs/****/vsadmin/db_conn_open.php:14 Stack trace: #0 /homepages/43/d162641710/htdocs/****/index.php(62): include() #1 {main} thrown

Any help would be appreciated, Thanks

Eric

seventh-gear
Advanced Member

USA
116 Posts

Pre-sales questions only
(More Details...)

Posted - 01/24/2019 :  22:10:05  
Figured it out.... Thanks.

Vince
Administrator

42874 Posts

Posted - 01/25/2019 :  01:11:06  
Hi Eric
I'm glad you got this figured out yourself. But if anyone else has the same problem it sounds like the changes to the database connection script hadn't been carried out. Details are here...
https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=107737

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000