mysql_pconnect() has been disabled for security reasons
How I connect to the mysq_pconnect?
I have this config:
<?php
define(开发者_JS百科'DB_HOST', 'localhost');
define('DB_USER', 'sampleuser');
define('DB_PASSWORD', 'samplepassword');
define('DB_DATABASE', 'sampledatabase');
$conn=mysql_pconnect(DB_HOST, DB_USER, DB_PASSWORD) or die ("Error connecting to " . DB_DATABASE);
mysql_select_db(DB_DATABASE) or die ("Error: Cannot access " . DB_DATABASE . " database");
?>
Do I have to fix anything to enable the mysql_pconnect()?
Why are you coding this way ? take a look at Doctrine DBAL , now to the point of your question: Some crappy hosts disable this function because lazy programmers often make a mess with persistent connections, leaving them open ad infinitum causing database server errors.
you do not need persistent connections. But the host should turn them off normally, not with disable-function.
The host has got it wrong, conplain!
精彩评论