加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

CentOS7+PHP8.1编译安装

(2022-07-04 13:51:46)
标签:

centos7

php

8.1

杂谈

分类: LINUX

1.下载

 yum install httpd-devel

yum install sqlite-devel -y

yum install bzip2 bzip2-devel -y

yum install curl-devel  -y

yum install gmp-devel  -y 

yum -y install oniguruma-devel

yum -y install postgresql-devel

yum -y install readline-devel


yum install libxslt-devel - y

由于使用postgrsql数据库,需要用到pdo_pgsql接口,发现一直无法加载,没办法采用php源代码重新安装

wget https://www.php.net/distributions/php-8.1.7.tar.gz    //解压源码包

cd php-8.1.7 .编译 #安装路径在/usr/local/php

./configure \

--prefix=/usr/local/php \

--with-config-file-path=/etc \

--enable-fpm \

--enable-inline-optimization \

--disable-debug \

--disable-rpath \

--enable-shared \

--enable-soap \

--with-libxml-dir \

--with-xmlrpc \

--with-openssl \

--with-mcrypt \

--with-mhash \

--with-pcre-regex \

--with-sqlite3 \

--with-zlib \

--enable-bcmath \

--with-iconv \

--with-bz2 \

--enable-calendar \

--with-curl \

--with-cdb \

--enable-dom \

--enable-exif \

--enable-fileinfo \

--enable-filter \

--with-pcre-dir \

--enable-ftp \

--with-gd \

--with-openssl-dir \

--with-jpeg-dir \

--with-png-dir \

--with-zlib-dir \

--with-freetype-dir \

--enable-gd-native-ttf \

--enable-gd-jis-conv \

--with-gettext \

--with-gmp \

--with-mhash \

--enable-json \

--enable-mbstring \

--enable-mbregex \

--enable-mbregex-backtrack \

--with-libmbfl \

--with-onig \

--enable-pdo \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-zlib-dir \

--with-pdo-sqlite \

--with-readline \

--enable-session \

--enable-shmop \

--enable-simplexml \

--enable-sockets \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-wddx \

--with-libxml-dir \

--with-xsl \

--enable-zip \

--enable-mysqlnd-compression-support \

--with-pear \

--enable-opcache \

--with-apxs2 \

--with-pdo-pgsql

//-with-apxs2  支持APACHE HTTP 

//--with-pdo-pgsql 支持PDO-PGSQL 

#make &&make install

3.设置环境变量 vi/etc/profile 在末尾追加

#这步不一定要运行,往往已经在PATH中

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

export PATH

#执行生效

source /etc/profile

5.配置php-fpm

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

cp /usr/local/php/etc/php-fpm.conf.default  /usr/local/php/etc/php-fpm.conf

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

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod +x /etc/init.d/php-fpm

6.编辑php-fpm 

error_log = /home/log/php-fpm.log

pid = /home/log/php-fpm.pid

7.编辑/usr/local/php/etc/php-fpm.conf

error_log = /var/log/php-fpm.log

pid = /var/run/php-fpm.pid




0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有