说明:之前项目使用laravel5.3 (php版本>=5.5.9)在不影响以前项目的情况下,新项目使用laravel5.7 (php版本>=7.1.3)
安装php7.1.3
(1)下载:
[root@lnmp ~]# cd /usr/local/src
[root@lnmp src]# wget -c http://cn2.php.net/distributions/php-7.2.8.tar.gz
(2)解压:
[root@lnmp src]# tar -zxvf php-7.2.8.tar.gz
(3)安装
安装依赖包
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel
[root@lnmp src]# cd php-7.2.8
[root@lnmp php-7.2.8]#
./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd-compression-support --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-intl --with-mcrypt --with-libmbfl --enable-ftp --with-gd --enable-gd-jis-conv --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --with-pear --enable-maintainer-zts --with-ldap=shared --without-gdbm
1,报错:configure: WARNING: unrecognized options: --with-mysql, --with-mcrypt, --with-curlwrappers, --enable-gd-native-ttf
解决:删除–with-mysql --enable-gd-native-ttf --with-mcrypt ,从新安装
安装目录为:–prefix=/usr/local/php7 (可自定义)
./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd-compression-support --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbs