-
Describe your problem
Server local run php index.php can connect MySQL, browser access server cannot connect MySQL
-
Paste the relevant code
index.php
-
Post error message
Not currently
-
Paste the relevant
-
What methods have been tried still unresolved (attached link)
Not currently
Reply content:
-
Describe your problem
Server local run php index.php can connect MySQL, browser access server cannot connect MySQL
-
Paste the relevant code
index.php
-
Post error message
Not currently
-
Paste the relevant
-
What methods have been tried still unresolved (attached link)
Not currently
Create a new file info.php write it in Phpinfo (); Print out detailed information. See if the MySQL extension is loaded first. And then say the rest.
Run the test under the terminal with non-root permissions php index.php To troubleshoot the permissions issue. By the way, the PHP error fully open to see if it was recorded by log
Open the error first to see what is wrong, it looks like death in Mysql_connect
Re-install lamp, now it's ready
The next time you use other resources, you can try this mysql_connect (...) or Die (Mysql_error ());