Okay, Here's a breakdown of what's up:
<? $foo = new Imagick(); ?>
works without error when ran from the command-line (e.g., sudo php myscript.phpFatal error: Class 'Imagick' not found in /var/www/lhackwith_www/test_html/magic.php on line 1
.Any advice would be appreciated.
I take it you're absolutely sure you've edited the right php.ini...
Did you check the webserver's error.log for hints? You might want to increase the LogLevel for that test. If it's an apache see http://httpd.apache.org/docs/2.2/mod/core.html#loglevel and http://httpd.apache.org/docs/2.2/logs.html#errorlog
or maybe ldd - print shared library dependencies can shed some light on the issue:
<?php
$p = get_cfg_var('extension_dir');
$modpath = $p.DIRECTORY_SEPARATOR.'imagick.so';
echo $modpath, is_readable($modpath) ? ' readable':' not readable', "<br />\n";
echo '<pre>';
passthru('ldd '.$modpath.' 2>&1'); // in case of spaces et al in the path-argument use escapeshellcmd()
echo '</pre>';
please run this script both on the command line and through the webserver. Does it complain about a missing dependency?
<?php
function foo($path) {
if ( $path==($dir=dirname($path)) ) {
return;
}
foo($dir);
echo
is_dir($path) ? ' d':' -',
is_readable($path) ? 'r':'-',
is_writable($path) ? 'w':'-',
is_executable($path) ? 'x ':'- ',
$path, "<br />\n";
}
$modpath = get_cfg_var('extension_dir').DIRECTORY_SEPARATOR.'imagick.so';
foo($modpath);