1

我想将我的php 5.3.3更新为php 5.3.8,我已经下载了 PHP5.3.8.tar.gzip

我的PHP 5.3.3 位于/usr/bin/php。当我尝试安装PHP5.3.8.tar.gzip并执行以下命令时:

./configure
make
make install

它安装在不同的位置/usr/local/bin/php

所以现在我有 2 个php 5.3.3php 5.3.8。所以我尝试再次安装并运行它

./configure -prefix=/usr/bin/php
make
make install

这次出现错误:

Installing PHP SAPI module:       cgi
mkdir: cannot create directory `/usr/bin/php': File exists
mkdir: cannot create directory `/usr/bin/php/bin': Not a directory
make: [install-sapi] Error 1 (ignored)
Installing PHP CGI binary: /usr/bin/php/bin/
cp: accessing `/usr/bin/php/bin/#INST@29239#': Not a directory
make: *** [install-sapi] Error 1

请帮助我,我想删除我安装在/usr/local/bin/php 中的php5.3.8 并将/usr/bin/php 更新为php5.3.8。我只需要php5.3.8版本。

谢谢。

4

2 回答 2

2

通常在 CentOS 上,你想把这种事情留给 yum。

yum update php

或者

sudo yum update php

您也可以将安装替换为较新的版本。5.3.X 不再受支持,所以你可以这样做:

yum install yum-plugin-replace
yum replace php --replace-with php55

如果您在 yum 中没有 php 5.5,请先执行以下操作:

cd ~
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm
rpm -Uvh epel-release-6-5.noarch.rpm ius-release-1.0-11.ius.centos6.noarch.rpm

如果您没有安装 wget:

yum install wget

请注意通过谷歌找到这个的所有其他人!!!

我在 wget 命令中链接的 URL 是CentOS 6的 epel 和 ius 存储库的当前版本。(它也可能已过时。)

如果您有 RHEL 或 CentOS 5,您可以在此处找到您的 RPM 的特定链接:http: //dl.iuscommunity.org/pub/ius/stable/

于 2013-09-27T20:10:38.490 回答
0

Why do you need 5.3.8 specifically? The last version of 5.3 was 5.3.27. 5.3 is end-of-life. I would find a modern repo like remi and install 5.4 or later using yum

于 2013-09-27T20:16:47.987 回答