安装APC的PECL不起作用。Shtool不存在。

21

我是一个绝对的新手……直到一个小时前才学习SSH,而且两个小时前才得到我的第一个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.`

请问您能否发布挂载命令的输出结果?也许您的 /var 分区已经设置了 nosuid 和 noexec。 - herrjeh42
2个回答

43

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

mount -o remount,exec /var/tmp/

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

mount -o remount,noexec /var/tmp/

3
工作得非常完美,但在Ubuntu上我需要运行 sudo mount -o remount,exec /tmp/ 然后再运行 sudo mount -o remount,noexec /tmp/ - Citricguy
1
请查看 apolinux 的回答,以获取更适合的解决方法。该方法也适用于不允许重新挂载 /tmp 的环境,例如共享主机或设置为 tempfs 的 Docker 容器。 - Martin Rüegg

19
尝试这个方法,它是从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安装。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接