Page 1 of 1
Site does not work after php update
Posted: Tue Dec 02, 2014 4:33 am
by yuremizov
My domain provider 1&1 told me that I need to update my php or I will have to pay more per month.
I update my php and my site stops working. Most buttons do nothing, and there is weird error text at the top of the page.
I backed up my site and decided to do a clean install.
On the control panel for 1&1, I get the information that my database is "MySQL5" and there is no way to change it.
The site is
http://www.skin-for-laptop.com
I have the following error during install after typing in the configuration details:
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /homepages/32/d350953638/htdocs/skinforlaptop/system/database/mysql.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at /homepages/32/d350953638/htdocs/skinforlaptop/system/database/mysql.php:6) in /homepages/32/d350953638/htdocs/skinforlaptop/system/engine/controller.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /homepages/32/d350953638/htdocs/skinforlaptop/system/database/mysql.php:6) in /homepages/32/d350953638/htdocs/skinforlaptop/system/engine/controller.php on line 29
Once this is fixed, I will plan to put in a template that I bought.
What can I do to fix this?
Re: Site does not work after php update
Posted: Tue Dec 02, 2014 8:57 pm
by MarketInSG
which version of opencart do you have? If you're on 1.5.6.x, try changing the 'mysql' to 'mysqli' in both your config.php files.
Re: Site does not work after php update
Posted: Wed Dec 03, 2014 1:36 am
by uksitebuilder
Also, for 1and1 hosting, if you normally use for the DB Host: localhost:/tmp/mysql5.sock
You should change the DB Host to just: localhost in config.php and admin/config.php and also add the following to the top of both configs on a new line after the opening php <?php tag
Code: Select all
ini_set ( 'mysqli.default_socket' , '/tmp/mysql5.sock' );
Re: Site does not work after php update
Posted: Wed Dec 03, 2014 2:06 am
by yuremizov
MarketInSG wrote:which version of opencart do you have? If you're on 1.5.6.x, try changing the 'mysql' to 'mysqli' in both your config.php files.
I am indeed on 1.5.6.x.
By making this change, what is happening exactly? What is MySQLi? I fear that if I change it, there will be some conflict with my database provider, and it will break even more.
Re: Site does not work after php update
Posted: Thu Dec 04, 2014 5:55 pm
by MarketInSG
there wouldn't be more issues. Give a try and switch mysql to mysqli as mysql is being deprecated on newer versions of PHP
Re: Site does not work after php update
Posted: Fri Dec 05, 2014 3:53 am
by yuremizov
Wow! Just simply changing that did fix it. I have no idea what changing it does, but it definitely worked, for a clean install. It took me a lot of time to put in my items and such, so I am now going to try to restore my backup, and upgrade to 1.5.6 rather than a clean install.
:/
After redoing my backup onto the server, then putting 1.5.6 files on top of that, then going to <site.com>/install (I see the upgrade page), and running the script, I get the same error In my first post. So I went into config.php and admin/config.php and changed the define DB_DRIVER from mysql to mysqli. That error is gone, and now I have a different error:
Warning: require_once(/homepages/32/d350953638/htdocs/system/startup.php): failed to open stream: No such file or directory in /homepages/32/d350953638/htdocs/skinforlaptop/index.php on line 17
Fatal error: require_once(): Failed opening required '/homepages/32/d350953638/htdocs/system/startup.php' (include_path='.:/usr/lib/php5.5') in /homepages/32/d350953638/htdocs/skinforlaptop/index.php on line 17
hum.... I just noticed it is looking in the wrong place. Where do I define where the root folder is? I used to keep my shop on root, but I made a subdirectory "skinforlaptop" and put opencart files there.
As far as I can tell, in my config.php I have to put the folder between the openCart folder (admin, system, etc.) and my site, I think. That would be the define functions under "// DIR" and above "// DB", right?
Where else would I need to edit?
Re: Site does not work after php update
Posted: Fri Dec 05, 2014 5:49 am
by uksitebuilder
config.php and admin/config.php
Also clear your system/cache directory and if you had previously installed vqmod, clear the vqmod/vqcache folder and delete vqmod/mods.cache file
Re: Site does not work after php update
Posted: Fri Dec 05, 2014 6:38 am
by yuremizov
Everything seems to be working, so my issue resolved.
Thank you for everything!
Re: Site does not work after php update
Posted: Thu May 28, 2015 10:01 pm
by alnaizak
hi guys
i have the same issue, 1&1 forced me to upgrade without any help on how things will be affected. Changing from mysql to mysqli worked for one of my sites, that was running the latest opencart version.
But my site
www.alnaizak.net running opencart 1.5.6 does not work after i changed mysql to mysqli, the site don't even load at all i just get this error
Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /homepages/7/d95492774/htdocs/alnaizak.net/system/database/mysqli.php on line 54
Please can someone give some help here now to fix it. I don't currently have a backup of this site, really don't wanna start from scratch.