MySQL Forums
Forum List  »  PHP

PHP do not connect to db using php scripts
Posted by: A S
Date: January 30, 2010 07:39AM

I installed Apache+Mysql+php in Windows 7.
PHP work properly and all php scripts work good.
apache work properly
MySQL work properly and by mysql_Administrator i can control it.
by phpinfo() it show mysql php info and it do not show any problem


but when i run a script in my web browser by localhost url; it do not access to DB!!
in php config : error_reporting = E_ALL & ~E_NOTICE

for exam for this code:

echo "hi";
$connect = mysql_connect("localhost","root","password") ;
if ($connect) {
	echo "ok"; 
	echo mysql_error();
	echo "failed";

it show this error report in my browser:

hi Warning: main(): 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 'UTC' for '3.5/no DST' instead in c:\Apache\htdocs\mysql.php on line 4 Fatal error: Maximum execution time of 60 seconds exceeded in c:\Apache\htdocs\mysql.php on line 4

it is impossible for all my scripts working with db!!

what is my problem? how i can solve it?

my localhost:
windows 7 ultimate 64bit
Apache/2.2.14 (Win32)
Server MySQL 5.0.22 community via TCP/IP
Client v5.0.11

Edited 2 time(s). Last edit at 01/30/2010 08:09AM by A S.

Options: ReplyQuote

Written By
PHP do not connect to db using php scripts
January 30, 2010 07:39AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.