2011-08-02 26 views
0

我试图使用在Drupal ImageMagick的工具包,但不断收到此错误:的Drupal/ImageMagick的错误:实际上open_basedir的限制

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,所以我想我可以编辑它,但是想知道编辑它是否正确吗?我担心在php.ini中将/ usr/bin/convert添加到允许的路径是否是安全问题,还是有另一种方法可以使其运行?

回答

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?

另外,跑了作为根:

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