PHP系列-编译安装

php是后端动态语言,主要是用php来处理逻辑和操作数据库等等

php是脚本语言,无需编译即可运行

php在web开发中应用广泛

 

 

php的下载地址

 

http://php.net/downloads.php

 

 

PHP编译安装

1.安装依赖包

yum -y install epel-release
yum -y install gcc gcc-c++ make pcre pcre-devel zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel openldap openldap-devel libmcrypt libmcrypt-devel sqlite-devel
oniguruma oniguruma-devel

2.安装

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-ctype --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-fpm
make && make instal

复制一个配置文件

cp php.ini-production /usr/local/php/etc/php.ini

安装验证

[root@Nginx php-7.4.6]# /usr/local/php/bin/php -v   #查看php版本
[root@Nginx php-7.4.6]# /usr/local/php/bin/php -m  #查看php模块
[root@Nginx php-7.4.6]#/usr/local/php/bin/php -i|grep configure  #查看php的环境检查参数

猜你喜欢

转载自www.cnblogs.com/gzsws/p/13405300.html