【问题标题】:pecl install apc isn't working. shtool does not existpecl 安装 apc 不工作。 shtool 不存在
【发布时间】:2013-03-19 12:16:28
【问题描述】:

我是一个绝对的新手……直到一个小时前才了解 SSh,并在 2 小时前获得了我的第一个 VPS。还在学习!

所以我正在安装 MediaWiki 并需要添加 APC 扩展。但是遇到了小麻烦。有什么想法/提示吗?

[root@www ~]# pecl install apc`
downloading APC-3.1.13.tgz ...
Starting to download APC-3.1.13.tgz (171,591 bytes)
.....................................done: 171,591 bytes
55 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
shtool at '/var/tmp/APC/build/shtool' does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.`

【问题讨论】:

  • 能否请您发布 mount 命令的输出?也许你的 /var 分区有 nosuid,noexec 设置

标签: php apc pecl


【解决方案1】:

使用以下命令从 /var/tmp 目录中删除 noexec 标志

mount -o remount,exec /var/tmp/

您可以使用相同的命令将 noexec 标志添加回来

mount -o remount,noexec /var/tmp/

【讨论】:

  • 完美运行,但在 Ubuntu 上我需要运行 sudo mount -o remount,exec /tmp/ 然后 sudo mount -o remount,noexec /tmp/
  • 查看 apolinux' answer 以获得更合适的解决方法,该解决方法也适用于不允许重新安装 /tmp 的环境,例如设置为 tempfs 时的共享主机或 docker 容器。
【解决方案2】:

试试这个,复制自http://blog.litespeedtech.com/2013/04/05/trouble-shooting-pecl-install-doesnt-work/

更合适的解决方法是将 PECL 的 temp_dir 指向 允许执行的分区或路径:

mkdir /root/tmp
pecl config-set temp_dir /root/tmp

pear config-set temp_dir /root/tmp

(有一个已知的错误,pecl config-set 不起作用,但 pear config-set 起作用。如果您遇到这种情况,只需使用 PEAR 配置命令。 PECL 将在安装时使用 PEAR。)

此解决方法保留了将 /tmp 设置为的任何安全优势 noexec,但也允许安装 PECL。

【讨论】:

    猜你喜欢
    • 2015-10-03
    • 1970-01-01
    • 2012-06-01
    • 2014-03-19
    • 2014-07-18
    • 1970-01-01
    • 2012-04-05
    • 2021-09-20
    • 1970-01-01
    相关资源
    最近更新 更多