如何在 centOS 上删除(升级)PHP 7 RC 到新的稳定版本?
谢谢
最佳答案
为了卸载 PHP 7.0 RC 并安装 PHP 7 Realeased 12 月 3 日的最终版本,首先您需要手动删除 PHP 7 RC 的目录和文件,为此您需要执行以下操作:
1步:
手动卸载 PHP-7.0.0RC1 文件夹
cd /opt
sudo rm -rf php-7.0.0RC1
2步:
卸载 libphp7.so
cd /usr/lib64/httpd/modules/
sudo rm -rf libphp7.so
3步:
从 php.net 官方页面下载 12 月 3 日发布的 PHP 7.0.0
sudo wget http://php.net/get/php-7.0.0.tar.bz2/from/this/mirror
4步:
从/opt 中提取 *tar.bz2 的文件
tar xzf php-7.0.0RC1.tar.gz -C /opt
5步:
完成后,让我们进入/opt/php-7.0.0 并使用 --force 开关执行 buildconf 脚本,以强制构建这个新版本。
cd /opt/php-7.0.0
ls
./buildconf --force
6步:
现在是时候执行配置命令了。虽然以下选项将确保标准的 PHP 7 安装,但您可以引用 PHP 手册中的完整选项列表,以便根据您的需要更好地自定义安装:
./configure \
--prefix=$HOME/php7/usr \
--with-config-file-path=$HOME/php7/usr/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-apxs2
7步:
完成后,执行以下命令:
make
在那之后:
make install
8步:
最后重新启动你的 apache 服务器
sudo /sbin/service httpd restart
9步:
它已经完成了!现在你可以运行 phpinfo() 检查安装的版本“PHP 7.0.0”。
关于centos - 在 centOS 上升级 PHP 7.0.0 RC1 到 PHP 7.0 当前稳定版?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34087290/