我按照this article中的说明安装并运行drush:
我的服务器是cloudlinux和cagefs.drupal7

Drush使用全局php.ini文件而不是drish.ini文件,此问题会给open_basedir和disable_finctions函数带来一些错误。

当我运行drush status命令时,请给我以下内容:

> The following restricted PHP modes have non-empty values:
> [error] open_basedir and disable_functions. This configuration is
> incompatible with drush.  Please check your configuration settings in
> /opt/cpanel/ea-php56/root/etc/php.ini or in your drush.ini file; see
> examples/example.drush.ini for details. is_dir(): open_basedir
> restriction in effect.                        [warning]
> File(/usr/share/drush/commands) is not within the allowed path(s):
> (/home/:/usr/lib/php:/usr/local/lib/php:/usr/local/bin:/usr/share/drush:/usr/share/drush/commands:/etc:/tmp)
> preflight.inc:518  PHP configuration      :
> /opt/cpanel/ea-php56/root/etc/php.ini
>                            /home/username/.drush/drush.ini  PHP OS                 :  Linux  Drush script           :  /usr/local/bin/drush  Drush
> version          :  8.1.9  Drush temp directory   :  /tmp  Drush
> configuration    :  Drush alias files      :

因此,对我来说drush使用 /opt/cpanel/ea-php56/root/etc/php.ini 而不是 /home/username/.drush/drush.ini

如何使用drush.ini文件而不是服务器php.ini文件?

我不想出于安全原因而编辑全局php.ini文件。

最佳答案

您是否尝试过将EXPORT PHP_INI =“/ home / username / .drush / drush.ini”添加到您的.bashrc文件中?

关于php - 如何使用drush.ini文件而不是全局php.ini文件-Drush,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42782190/

10-13 05:45