HDFilmMaker2112 Posted June 3, 2012 Share Posted June 3, 2012 I'm trying to connect to MySQLi via a persistent connection and I'm getting an error stating: Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2005): Unknown MySQL server host 'p:localhost' (1) function MysqliPersist($dbname){ $DBconnect = new mysqli_errordisplay('p:localhost', "user", "pass", $dbname); return $DBconnect; } In the manual it says to prepend a "p:" to the host name for a persistent connection. Quote Link to comment https://forums.phpfreaks.com/topic/263586-unknown-mysql-server-host-plocalhost/ Share on other sites More sharing options...
HDFilmMaker2112 Posted June 3, 2012 Author Share Posted June 3, 2012 Believe I figured it out. My web host is still on PHP 5.2... Quote Link to comment https://forums.phpfreaks.com/topic/263586-unknown-mysql-server-host-plocalhost/#findComment-1350841 Share on other sites More sharing options...
smoseley Posted June 3, 2012 Share Posted June 3, 2012 Lose the "p:", just "localhost". Quote Link to comment https://forums.phpfreaks.com/topic/263586-unknown-mysql-server-host-plocalhost/#findComment-1350842 Share on other sites More sharing options...
PFMaBiSmAd Posted June 3, 2012 Share Posted June 3, 2012 Persistent database connections only work when php is running as a server module, not when php is running as a cgi application. Are you sure trying to use a persistent connection would have any effect on your server? Quote Link to comment https://forums.phpfreaks.com/topic/263586-unknown-mysql-server-host-plocalhost/#findComment-1350849 Share on other sites More sharing options...
HDFilmMaker2112 Posted June 3, 2012 Author Share Posted June 3, 2012 Persistent database connections only work when php is running as a server module, not when php is running as a cgi application. Are you sure trying to use a persistent connection would have any effect on your server? MySQLi Persistent connections weren't included in PHP until 5.3. My web server is currently running 5.2... That's the current problem. Quote Link to comment https://forums.phpfreaks.com/topic/263586-unknown-mysql-server-host-plocalhost/#findComment-1350877 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.