0

我正在尝试在 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 论坛和“周围”的许多帖子,并尝试了各种建议的解决方案(将我在 Drupal 中的目录设置为 /sites/default/files/tmp 等),但到目前为止,没有任何效果。在这一点上,因为我确实可以访问 php.ini,所以我想我可以编辑它,但我想知道编辑它是否是正确的方法?我担心将 /usr/bin/convert 添加到 php.ini 中的允许路径是否是一个安全问题,或者是否有其他方法可以让它工作?

4

1 回答 1

1

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

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

如何放宽 PHP 的 open_basedir 限制?

此外,以 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
于 2011-10-03T22:10:14.980 回答