Web Design Blog - September 21, 2010

function_exists to test if extension is installed

Many make use of GD through php to resize and process images. Some hosting environments do not have php compiled with GD support. If your script is run on one of those hosting environments it will fail. If you plan on distributing your script you can add some tests to see if GD is installed, a very basic way to test for it would be to see if a function that extension provides has been defined. if ( ! function_exists('imagecreate') ) { die('GD must be installed to use this script'); } You can... read more!

Posted in php | Post Comment


View All Posts
web design corner image