Jump to content

Copy Test Website on Subdomain - Deprecated: mysql_connect():


ishi

Recommended Posts

I am trying to upgrade a website from PS V 1.4.5.1 to Latest (1.6.x)
I have copied all files to test.domain.com
I have copied database to new MySQL5.1 Database (which is the original type of database).
 
I edited the settings.inc.php file to point to the new database and turned on error handling.
 
I open test.domain.com and this is what I see.

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/classes/MySQL.php on line 34

Fatal error: Uncaught exception 'ReflectionException' with message 'Class ValidateCore does not exist' in /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/config/autoload.php:52 Stack trace: #0 /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/config/autoload.php(52): ReflectionClass->__construct('ValidateCore') #1 /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/classes/ObjectModel.php(111): __autoload('Validate') #2 /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/classes/FrontController.php(92): ObjectModelCore->__construct(21, '1') #3 /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/classes/FrontController.php(62): FrontControllerCore->init() #4 /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/index.php(29): FrontControllerCore->run() #5 {main} thrown in /mnt/target05/350791/359065/test.tophydraulicsinc.com/web/content/config/autoload.php on line 52

I open test.domain.com/adminxxx and this is what I see.

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

Warning: Cannot modify header information

Can someone please help me!  I don't understand how an exact copy of what is working, doesn't work.

 

 

Link to comment
Share on other sites

The deprecated message comes from php, not from mysql. 

 

As those warnings come early they cause the "cannot modify header information" problem. You can disable the warnings in two ways:

 - you can put an at-sign in front of the command: @mysql_connect()

 - you can insert the line "error_reporting(E_ALL ^ E_DEPRECATED);" somewhere in the software. The most logical place would be defines.inc.php where you also set the development mode. There you could replace "@error_reporting(E_ALL | E_STRICT);" with "@error_reporting((E_ALL | E_STRICT) ^ E_DEPRECATED);".

 

I have no idea what the ReflectionException is about.

Link to comment
Share on other sites

Thank you musicmaster.   I was able to get rid of the Deprecated: mysql_connect()  error with your advice but still getting the ReflectionException error message - so not able to see front or back end of site.

 

What is the reasoning behind an exact copy/paste of a website to a new location showing these errors when the original site does not?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...