Drupal / ImageMagick错误:open_basedir限制生效

时间:2011-08-02 16:07:49

标签: drupal imagemagick open-basedir

我正在尝试在Drupal中使用ImageMagick工具包,但不断收到此错误:

warning: file_exists(): open_basedir restriction in effect. 
File(/usr/bin/convert) is not within the allowed path(s): 
(/var/www/vhosts/dev.mysite.com/dev2.mysite.com/drupal/:/tmp/) in 
/var/www/vhosts/dev.mysite.com/dev2.mysite.com/drupal-6.22/includes/image.imagemagick.inc 
on line 55.
No file /usr/bin/convert could be found. PHP's open_basedir security restriction 
is set to /var/www/vhosts/dev.mysite.com/dev2.mysite.com/drupal/:/tmp/, which 
may be interfering with the attempts to locate ImageMagick.

我在Drupal论坛和“around”上阅读了很多帖子,并尝试了各种建议的解决方案(将我在Drupal中的目录设置为/ sites / default / files / tmp等),但到目前为止,没有任何工作。此时,由于我可以访问php.ini,我以为我可以编辑它,但我想知道编辑它是否是正确的方法?我担心将/ usr / bin / convert添加到php.ini中的允许路径是一个安全问题,还是有另一种方法可以让它工作?

1 个答案:

答案 0 :(得分:1)

在/var/www/vhosts/domain.tld/conf中创建了vhost.conf并重新启动了apache

<Directory /var/www/vhosts/domain.tld/httpdocs>
php_admin_value open_basedir none
</Directory>

How can I relax PHP's open_basedir restriction?

另外,以root身份运行:

yum install ImageMagick
yum install ImageMagick-devel
yum install php-pear
pecl install imagick

http://24x7servermanagement.com/blog/?p=754

然而,最后一步我遇到了问题。当我打电话给服务器公司时它解决了,我认为它们已经运行了

yum install kernel-devel kernel-headers