gabrielkolbe Posted August 11, 2008 Share Posted August 11, 2008 Hi, I have a website, which I want to install on 'clients' servers..the website run on PHP, MySQL. Firstly I want a page to check if PHP is installed, then MySQL, then smtp, gd, curl. Can I use the phpinfo(), ? I tried to use phpinfo() place it in a string and search the strings for certain values, but it does not seem to work.. does anyone have any ideas, or better any scripts I can just edit? I would be greatful. Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/ Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 You can try function_exists() to test for certain functions, or you can just pass the phpinfo() data to grep or something. Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613594 Share on other sites More sharing options...
gabrielkolbe Posted August 11, 2008 Author Share Posted August 11, 2008 Hi, thanks for that. I can use function_exist, but also need to verify the data in the phpinfo() page.. i don't understand 'pass the phpinfo() data to grep or something.' please explain. I probably need to get phpinfo() into a string..?? Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613711 Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 Yeah. <?php ob_start(); phpinfo(); $phpinfo = ob_get_clean(); From that point, you can just use a regex or something, or grep. Whatever you want. Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613726 Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 function_exists is by far the cleanest way to do this. Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613728 Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 function_exists is by far the cleanest way to do this. Indeed it is. xD Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613731 Share on other sites More sharing options...
gabrielkolbe Posted August 11, 2008 Author Share Posted August 11, 2008 yes, I agree. But how do you check if the php dependencies are available (like smtp, gd, curl) with function_exist() ? Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613733 Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 Use a function from that library? if (function_exists('curl_init')) { //curl good } if (function_exists('imagecreatetruecolor')) { //gd good } And what's a function in the SMTP library? o-O Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613737 Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 You will also have to check if the function is disabled. function is_disabled($function) { $disabled_functions=explode(',',ini_get('disable_functions')); return in_array($function, $disabled_functions); } is_callable may do this for you, if you have a later version of PHP http://php.net/manual/en/function.is-callable.php Link to comment https://forums.phpfreaks.com/topic/119159-help-with-installation-creation-file/#findComment-613786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.