我的网络托管人员说ImageMagic已预安装在服务器上。我在phpinfo()的输出中快速搜索了“ ImageMagick”,却一无所获。我无法在服务器中使用SSH,因此PHP中是否可以验证安装?
尝试这个:
<?php //This function prints a text array as an html list. function alist ($array) { $alist = "<ul>"; for ($i = 0; $i < sizeof($array); $i++) { $alist .= "<li>$array[$i]"; } $alist .= "</ul>"; return $alist; } //Try to get ImageMagick "convert" program version number. exec("convert -version", $out, $rcode); //Print the return code: 0 if OK, nonzero if error. echo "Version return code is $rcode <br>"; //Print the output of "convert -version" echo alist($out); ?>