PECL 安装失败

发布于 2024-07-21 20:36:10 字数 452 浏览 5 评论 0原文

我浏览了所有谷歌结果,阅读了所有有关此错误的论坛帖子,但我无法解决它。

当使用 PECL 安装进行任何操作时,我总是会收到此错误:

checking whether the C compiler works... configure: error: cannot run C compiled programs.

到目前为止,其他一切都成功了!

我使用的是CentOS 4.3,PEAR是最新的稳定版本,GCC是最新的稳定版本。 一切都按预期工作,但 C 编译器似乎总是出错。 我尝试通过暂时启用 tmp 来使 tmp 具有操作的正确权限:

mount -o remount,exec,suid /tmp

但这不起作用。

我确实尝试了所建议的所有内容,但均无济于事。 有任何想法吗?

I have browsed every Google result, read all the forum posts about this error, but I cannot solve it.

When using PECL install for anything, I always end up getting this error:

checking whether the C compiler works... configure: error: cannot run C compiled programs.

Everything else succeeds up to that point them bam!

I'm using CentOS 4.3, PEAR is the latest stable version, GCC is a stable and recent version. Everything is working as it should, but the C compiler always seems to error. I've tried to make tmp have the right privilages for the operation by temporarily enabling it using:

mount -o remount,exec,suid /tmp

But that doesn't work.

I've literally tried everything that has been suggested by to no avail. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

东京女 2024-07-28 20:36:10

我使用的是 Centos 5.3,通过删除 /tmp /var/tmp 上的 noexec 标志,我能够成功运行 PECL 安装程序(在我的例子中是 APC),

mount -o remount,exec,suid /tmp
mount -o remount,exec,suid /var/tmp

仅在 /tmp 上执行此操作没有不起作用 - 我仍然收到错误“正在检查 C 编译器是否工作...配置:错误:无法运行 C 编译的程序。”

请记住在安装完成后使用 noexec 再次运行这些重新安装。

I'm on Centos 5.3 and I was able to get PECL installers running (APC in my case) successfully by removing the noexec flag on both /tmp and /var/tmp

mount -o remount,exec,suid /tmp
mount -o remount,exec,suid /var/tmp

Doing this only on /tmp didn't work - I still received the error "checking whether the C compiler works... configure: error: cannot run C compiled programs."

Remember to run these remounts again with noexec after your install finishes.

温柔嚣张 2024-07-28 20:36:10
cd ~
mkdir setups
cd setups
wget http://pecl.php.net/get/APC-3.1.2.tgz
tar -xvf APC-3.1.2.tgz
cd APC-3.1.2
phpize && ./configure --with-apxs && make

我很快就把它写下来,并且能够通过一些手动工作来安装 APC。 例如将模块复制到PHP模块并将扩展添加到php.ini。 现在工作完美。

cd ~
mkdir setups
cd setups
wget http://pecl.php.net/get/APC-3.1.2.tgz
tar -xvf APC-3.1.2.tgz
cd APC-3.1.2
phpize && ./configure --with-apxs && make

I quickly wrote that up and was able to install APC with a bit of manual work. Such as copying the module to PHP modules and adding the extension to the php.ini. Works perfectly now.

执着的年纪 2024-07-28 20:36:10

当我安装 MongoDB 驱动程序时遇到类似问题时,这对我有用:

sudo mkdir /root/tmp.pear
sudo mkdir /root/tmp.pear-build-root

sudo ln -s /root/tmp.pear /tmp/pear
sudo ln -s /root/tmp.pear-build-root /tmp/pear-build-root

然后:(

sudo sudo pecl install XXX

这不会打开安全漏洞,因为只有 root 可以在这两个目录中创建可执行文件。)

请注意,以下内容不会 为 PECL 工作:

sudo pear config-set temp_dir /var/tmp/pear/temp

When I had similar problems installing the MongoDB driver, this worked for me:

sudo mkdir /root/tmp.pear
sudo mkdir /root/tmp.pear-build-root

sudo ln -s /root/tmp.pear /tmp/pear
sudo ln -s /root/tmp.pear-build-root /tmp/pear-build-root

Then:

sudo sudo pecl install XXX

(This doesn't open a security hole because only root can create executables in those two directories.)

Note that the following does not work for PECL:

sudo pear config-set temp_dir /var/tmp/pear/temp
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文