Jump to content

PHP MySQL error


ApocalypeX

Recommended Posts

I just updated my PHP on my windows laptop from 5.1 to 5.3.3. Its works perfectly on my IIS7.5 but when I try to load a page that connects to my database I get this warning.I'm using the mysql from before my upgrade which is 5.1.42

Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead in D:\IIS\DEV\BA\db.php on line 2 Warning: mysql_connect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in D:\IIS\DEV\BA\db.php on line 2
Any ideas?
Link to comment
Share on other sites

Have you tried adding a call to date_default_timezone_set? The error message looks strange.
If i create a file with just<?phpecho date_default_timezone_set('Europe/London');?>It echoes 1if I add the line to my db file I get this error
Warning: mysql_connect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in D:\IIS\DEV\BA\db.php on line 3 Warning: mysql_connect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in D:\IIS\DEV\BA\db.php on line 3 Could not connect: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Link to comment
Share on other sites

Ok here is how to fix this error:Go to you PHP.ini config file and uncomment ;date.timezone =And set it to your time zone. For me it would look like this.date.timezone = 'Europe/London'

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...