【发布时间】:2023-03-14 03:36:01
【问题描述】:
我想在我的 VPS 上使用 drush 来执行 drupal 维护任务。但是,根据我安装的firewall 的自检结果的建议,我已经禁止 php 中的 exec()。 Drush 显然想要这个特权,我已经看到了三个选项来完成这项工作。
- 启用 exec()
- 使用php安全模式
- 将帐户的 php.ini 更改为“disable_functions = system, exec, shell_exec, passthru”
我的帐户是 Linux VPS 上的唯一管理员,我不打算更改它。我是 VPS 及其安全问题的新手。请告知哪个选项提供更安全的方法。
终端输出:
>exec() has been disabled for security reasons bootstrap.inc:639 [warning]
The following restricted PHP modes have non-empty values: [error]
disable_functions and magic_quotes_gpc. This configuration is
incompatible with drush. Please check your configuration settings in
/usr/local/lib/php.ini or in your drush.ini file; see
examples/example.drush.ini for details.
exec() has been disabled for security reasons exec.inc:150 [warning]
exec() has been disabled for security reasons exec.inc:150 [warning]
exec() has been disabled for security reasons exec.inc:150 [warning]
unlink(/home/site1/drush/lib/package.xml): No such file or [warning]
directory drush.inc:798
The drush command 'status' could not be found. Run `drush [error]
cache-clear drush` to clear the commandfile cache if you have
installed new extensions.
Drush needs a copy of the PEAR Console_Table library in order to [error]
function, and the attempt to download this file automatically failed.
To continue you will need to download the 1.1.3 package from
http://pear.php.net/package/Console_Table, extract it into
/home/site1/drush/lib directory, such that Table.php exists at
/home/site1/drush/lib/Console_Table-1.1.3/Table.php.
【问题讨论】:
-
你需要 exec() 来启动 drush,还是 drush 需要 exec()?
-
看起来我需要启动它,我已经编辑了问题以包含 cli 输出。
-
如果你只需要它来启动 drush,那么无论你是使用 cron 定期执行维护还是手动运行它,你都可以用不同的语言编写一个小脚本来启动应用程序,像 python 或 java 这样的语言就可以了。
标签: php linux security vps drush