2011-08-02 44 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