Knowledge Base Article

How to check if a PHP function is available on the server?

You can check whether a PHP function is enabled by using the function_exists function in a simple PHP script. For example, if you wish to check whether the fsockopen function is enabled, you can put the following code in a php file:

<?php
if(function_exists('fsockopen')) {
echo "fsockopen function is enabled";
}
else {
echo "fsockopen is not enabled";
}
?>

 

Then you should open the file in a browser and see the result :)

 

Please note that on SiteGround's servers there are no blocked/disabled PHP functions.



Rating

Please indicate if this article was helpful for you.

rating :  4.7 from 5
views :  3098
votes :  18

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!