Link to home
Start Free TrialLog in
Avatar of Isisagate
Isisagate

asked on

Script to check Server Configs

I am writing a PHP script to test that tests to make sure the server has the proper configs set for our software. There are a couple I'm not 100% sure how to test.

1. Make sure the server has mysql installed and available without specifying any settings.
2. Make sure the curl library is available

I need some code that determines these. All it needs to do is say passed or failed.


Anyone got an example?

I was trying this that I found on PHP.net for the mysql but the shell_exec looks like a potential problem as it may be disabled on most servers.

function find_SQL_Version() {
   $output = shell_exec('mysql -V');
   preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
   return $version[0];
}

Avatar of Aamir Saeed
Aamir Saeed
Flag of Pakistan image

Avatar of Isisagate
Isisagate

ASKER

phpinfo isn't what I am looking for... this is an attempt to write a script that a non-programmer business owner can upload and know that their hosting is sufficient to use the scripts. So it has to be minimal.
ASKER CERTIFIED SOLUTION
Avatar of DrBrainiac
DrBrainiac

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Im sorry, now I test this myself i see it is a different message: "Call to undefined function"
So change "unknown command" to this and it should work