gpt4 book ai didi

php - 如何更改默认的 Pear/PECL 构建文件夹 from/var/tmp?

转载 作者:太空狗 更新时间:2023-10-29 11:47:59 26 4
gpt4 key购买 nike

我正在尝试在 Linux 上安装 PECL 包,但安装程序从未通过配置阶段。

我的托管服务提供商在/var/tmp 上安装了一个文件系统,它阻止了文件的执行,这导致了这个错误:

root@host [/usr/local/apache/conf/includes]# pecl install pdo
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/PDO-1.0.3
running: /root/tmp/pear/PDO/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/PDO/configure' failed

我 99% 确定问题是您无法执行/var/tmp 中的文件(我在这里复制了一个可执行文件并尝试验证)。如果我让 PECL 在其他地方完成构建工作,我确信我可以让 PECL 完成,但我找不到合适的配置设置。

如何告诉 PECL 在非默认文件夹中构建?

最佳答案

哇,你为什么要从 PECL 安装 PDO?自 5.1 以来,PDO 已内置到 PHP 中。您在运行 5.0 吗?

如果您运行的是 5.1 或更高版本并且缺少 PDO,则可能是:

  1. 您的 PHP 副本是在没有它的情况下编译的,必须重新编译;或
  2. 您的 PHP 副本是从操作系统的存储库安装的,没有 PDO 模块

如果是 1,您需要从头开始重新编译 PHP,或者只编译共享模块并将其复制到正确的位置。

如果是 2,您只需要安装操作系统的 PDO 扩展。在 RHEL 和 CentOS 下,尝试 yum search php-pdo。我不知道为其他发行版调用包安装程序的正确语法,但包几乎肯定会包含字符串“php-pdo”。 (提示:如果您的 PHP 是从您的操作系统获取的,它们也可能会提供通用的 PECL 包。尝试在它们的存储库中搜索“pecl”。)

最后,如果您运行的是 5.0...为了这个世界上所有美好的事物,请升级!通读 upgrade notes in the PHP manual first ,以防万一您不小心使用了旧行为。

(此外,要重新配置 pecl,请尝试 pecl config-show 查看可用的设置,然后使用 pecl config-set ... 更改设置. 不要尝试为 5.0.x 以上的 PHP 版本安装 PDO 扩展,它崩溃PDO page on the PECL site 顶部甚至有一个大胖框.)

关于php - 如何更改默认的 Pear/PECL 构建文件夹 from/var/tmp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3096980/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com