美文网首页
Centos 7 安装PHP

Centos 7 安装PHP

作者: lemon_jun | 来源:发表于2018-12-21 15:38 被阅读0次

下载最新版PHP安装包(保证PHP依赖g++ gcc等环境的安装)

wget http://cn2.php.net/get/php-7.3.0.tar.gz/from/this/mirror 
#下载完毕
mv mirror ./php7.tar.gz
tar zxf php7.tar.gz
cd php7.tar.gz
#官方文档上with-mysql  需要修改为with-pdo-mysql 因为新版不支持mysql了
#make的时候错误提示apprentice.lo内存不足1G  需要在配置中新增--disable-fileinfo 为了方便添加其它扩展重新编辑命令。
./configure --prefix=/usr/local/php --with-curl --with-freetype-dir --with-gd --with-
gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-
mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --
with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash -
-enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-
native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-
shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip --disable-fileinfo
#在编译时错误提示 configure: error: Please reinstall the libzip distributio 或  configure: error: system libzip must be upgraded to version >= 0.11。使用Yum最新版只到0.10,不足以达到要求
yum remove libzip -y
wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install
重新手动安装 再次编译 提示,configure: error: off_t undefined; check your library configuration
echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf&&ldconfig -v   解决
再次编译 提示,configure: WARNING: unrecognized options: --enable-gd-native-ttf 由于安装的是7.3版本PHP   这个版本此编译已经废弃不用 删掉即可
make
sudo make install

如此安装完毕

相关文章

网友评论

      本文标题:Centos 7 安装PHP

      本文链接:https://www.haomeiwen.com/subject/ebzpkqtx.html