ttocskcaj Posted January 31, 2011 Share Posted January 31, 2011 How do you check if a MySQL or MySQLi server is available through php. I'm trying to make a short script that makes sure the users server can run the application. Like all the popular ones do Link to comment https://forums.phpfreaks.com/topic/226290-check-what-database-servers-are-available/ Share on other sites More sharing options...
requinix Posted January 31, 2011 Share Posted January 31, 2011 Easiest thing is to just try to connect. Like, normally. With the username and password and all that. If it bombs (eg, times out) then either there's no server there or the connection info is wrong. Link to comment https://forums.phpfreaks.com/topic/226290-check-what-database-servers-are-available/#findComment-1168092 Share on other sites More sharing options...
ttocskcaj Posted January 31, 2011 Author Share Posted January 31, 2011 That's what I'm doing at the moment. I would like to check before they enter any configurations though. Ie the MySQL server doesn't have a server to connect to yet. Is there a way to check if the MySQL extension is enabled? Link to comment https://forums.phpfreaks.com/topic/226290-check-what-database-servers-are-available/#findComment-1168104 Share on other sites More sharing options...
requinix Posted February 1, 2011 Share Posted February 1, 2011 How will you know where to look for a server if they haven't told you yet? You can check for the extensions with extension_loaded. Link to comment https://forums.phpfreaks.com/topic/226290-check-what-database-servers-are-available/#findComment-1168131 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.