Linux centos7.5 安装php7.3.2

1.下载php

wget http://am1.php.net/distributions/php-7.3.2.tar.gz

2.解压

tar zxvf php-7.3.2.tar.gz

 

3.安装扩展

yum install -y libxml-devel libxml2

yum install -y libxslt-devel

yum install -y openssl openssl-devel 

yum install -y libcurl-devel

yum install -y libXpm-devel

yum install -y zlib zlib-devel

 

4.配置

./configure --prefix=/usr/local/php  --with-pdo-mysql  --with-mysql-sock  --with-mysqli --with-gd --with-png --with-jpeg --with-freetype --with-xpm- --with-zlib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --enable-ctype

 

5.编译安装

make && make install

 

6.配置php相关文件

配置php.ini,cp /php解压的目录/php.ini-development    /usr/local/php/lib/php.ini

配置php-fpm.conf,cp /usr/local/php/etc/php-fpm.conf.default  /usr/local/php/etc/php-fpm.conf

配置www.conf,cp /usr/local/php/etc/php-fpm.d/www.conf.default  /usr/local/php/etc/php-fpm.d/www.conf

 

7.Php配置全局变量

vim ~/.bashrc

在文件尾增加:

export PATH=/usr/local/php/bin:$PATH

export PATH=/usr/local/php/sbin:$PATH

保存后重载一下

source ~/.bashrc

 

 

问题1:

configure: error: Please reinstall the libzip distribution

解决1:

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

 

问题2:

fatal error: zipconf.h: No such file or directory  #include

解决2:

cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

 

还有几个问题当时没记录忘记了,有空再补上,好像是图片扩展没有安装

你可能感兴趣的:(php,linux,centos)