如何从/var/tmp 更改默认的 Pear/PECL 构建文件夹? [英] How do you change the default Pear/PECL build folder from /var/tmp?

查看:70
本文介绍了如何从/var/tmp 更改默认的 Pear/PECL 构建文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to install a PECL package on Linux, but the installer never gets past the configure stage.

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

My hosting provider mounted a file system at /var/tmp that prevents files from executing, and that's causing this error:

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 在其他地方完成它的构建工作,我可以完成它,但我找不到合适的配置设置.

I'm 99% sure the problem is that you can't execute files in /var/tmp (I copied an executable file over here and tried it to verify). I'm sure I can get PECL to complete if I have it do its build work somewhere else, but I can't find the appropriate configuration setting.

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

How do you tell PECL to build in a non-default folder?

推荐答案

哇,你为什么要从 PECL 安装 PDO?PDO 从 5.1 开始就被内置到 PHP 中.你在运行 5.0 吗?

Whoa, why are you installing PDO from PECL? PDO has been built in to PHP since 5.1. Are you running 5.0?

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

If you're running 5.1 or higher and are missing PDO, chances are that:

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

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

If 1, you'll need to either recompile PHP from scratch, or compile just the shared module and copy it to the correct location.

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

If 2, you'll just need to install your OS's PDO extension. Under RHEL and CentOS, try yum search php-pdo. I don't know the proper syntax for calling the package installer for other distros, but the package will almost certainly include the string "php-pdo". (Tip: If you got your PHP from your OS, they also might provide common PECL packages. Try searching for "pecl" in their repositories.)

最后,如果您正在运行 5.0... 为了这个世界上所有美好的事物,请升级!请先通读PHP 手册中的升级说明,以防万一意外地重新使用旧的行为.

Finally, if you're running 5.0... for the sake of all that is good in this world, upgrade! Read through the upgrade notes in the PHP manual first, just in case you're using old behavior by accident.

(另外,要重新配置 pecl,请尝试 pecl config-show 以查看可用的设置,然后使用 pecl config-set ... 更改设置. 不要尝试为高于 5.0.x 的 PHP 版本安装 PDO 扩展,它破坏.在顶部甚至有一个大胖框a href="http://pecl.php.net/package/PDO" rel="nofollow noreferrer">PECL 网站上的 PDO 页面.)

(Also, to reconfigure pecl, try pecl config-show to see what settings are available, followed by a pecl config-set ... to change a setting. Do not try to install the PDO extension for a version of PHP newer than 5.0.x, it will break. There's even a big fat box at the top of the PDO page on the PECL site.)

这篇关于如何从/var/tmp 更改默认的 Pear/PECL 构建文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆