小注:此教程可能有很多弯路,但是最终是肯定安装成功了的,一个问题就是刚开始安装编译的指令版本好像不对,但是后面纠正过来了,但是此教程一共遇到了 十多个问题,也一并解决了,具有一定的借鉴意义,还有(django)开头是因为此刻处在 vir...虚拟环境中,不影响。(提醒:安装这个的或许也在搭建 Django + mysql + uwsgi + nginx,然后百度得到了一大堆需要安装PHP-FPM或者与PHP-FPM相关的,请仔细对比自己的错误信息和提出此解决方案的人的错误信息是否一致,错误信息在日志中查询。。)
安装php-fpm
  (新买的阿里云 默认 没有 php-fpm)

  下载php

 wget https://www.php.net/distributions/php-7.3.8.tar.gz

  解压安装

 tar -xvf php-7.3.8.tar.gz

  ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear
  然后可能会出现错误

  解决办法:

 yum install libxml2-devel

  查看是否成功

 find / -name "xml2-config"

 然后无限进行解压后的安装步骤,找错误,直到解决所有毛病的说,可能我遇到的,你没有遇到,也说不定,下面的错误解决方案只值得借鉴。。。(适不适合 那就不晓得了)

  解决办法  重新装下 curl

 yum -y install curl-devel

  解决办法

yum -y install libzip-devel

  解决办法  这是由于系统的自带的 libzip版本低了,所以先卸载系统自带的libzip

yum  -y remove libzip-devel

  然后在官网下载并且编译安装

(由于1.5以及以上的安装方式和版本下的不同,所以这里还需要安装个东西)

yum -y install cmake

  然后切回 local目录(版本可能更新了)

wget https://libzip.org/download/libzip-1.5.2.tar.xz

 解压安装

 tar xvf libzip-1.5.2.tar.xz

 cd libzip-1.5.2

 mkdir build

 cd build

 cmake ..
 此时,可能会发现 cmake版本低了

  所以需要更新 cmake版本 (ε=(´ο`*)))唉)

cd /usr/local

首先先,移除 cmake

yum remove cmake

https://cmake.org/download/

  下载 cmake最新版(自己找官网复制链接)

wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz

  解压

tar -xvf cmake-3.15.2.tar.gz

  进入cmake3.15.2文件夹,安装

 cd cmake-3.15.2

 ./configure

 make

 make install

  安装成功后,

  下面添加cmake环境变量,编辑 /etc/profile.d/cmake.sh 文件,写入以下内容:

export CMAKE_HOME=/usr/local/cmake-3.15.2
export PATH=$PATH:$CMAKE_HOME/bin

  保存并退出,执行命令让cmake环境文件生效

source /etc/profile
  此时,你再次查看cmake版本,就已经是3.15.2了

(django) [root@h1 cmake-3.15.2]# cmake --version
cmake version 3.15.2

  再进行 libzip的安装

 cd /usr/local/libzip-1.5.2

 cd build

 cmake ..

 make && make install

  安装完成

  再进行 php 的安装测验

cd /usr/local/php-7.3.8

 ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear

  

  又可能出现问题(一个个接近呗)

   解决方法

 vim /etc/ld.so.conf
#添加如下几行
/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64
#保存退出
:wq
ldconfig -v # 使之生效

  编译php后发生warning:configure:WARNING:unrecognizedoptions:--with-mysql 只是php7版本不支持mysql模块

   ./configure --help 查看configure的正确语法,重新编译php支持mysql,改用--with-pdo-mysql

  php7版本正确的编译语句是:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/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

  解决办法:

 rpm -qa | grep libjpeg
yum -y install libjpeg-devel
yum list installed | grep libjpeg
再次编译即可

  解决方法:

yum install -y libicu-devel

  解决方法
   检查下面是不是已经安装,如果没有安装之:
    检查:

 yum list openldap
yum list openldap-devel

    安装 :

 yum install openldap
yum install openldap-devel

  configure: error: Cannot find ldap libraries in /usr/lib

  解决方法

cp -frp /usr/lib64/libldap* /usr/lib/

  此时,发现换成7.3版本的编译指令

./configure --enable-fpm --prefix=/alidata/server/php7.3 --with-config-file-path=/alidata/server/php7.3/etc  --with-curl  --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 --enable-zip --with-zlib-dir=DIR --with-pcre-dir --with-libzip=DIR --with-openssl --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip

  解决办法

yum -y install libxslt libxslt-devel

  终于成功!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (总共出现了 12个问题)
  然后再进入正题
  编译

make
make install 

  注意这里,可以看出
  php添加到环境变量中的应该为  /alidata/server/php7.3/bin/
配置环境变量(添加 PHP 命令到环境变量)

vim /etc/profile

在末尾加入

 PATH=$PATH:/alidata/server/php7.3/bin/

 export PATH
要使改动立即生效

. /etc/profile 或 source /etc/profile

查看环境变量

echo $PATH
查看php版本

(django) [root@h1 php-7.3.8]# php -v
PHP 7.3.8 (cli) (built: Aug 9 2019 21:27:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
(django) [root@h1 php-7.3.8]#

配置启动 php-fpm

 Installing shared extensions:     /alidata/server/php7.3/lib/php/extensions/no-debug-non-zts-20180731/
Installing PHP CLI binary: /alidata/server/php7.3/bin/
Installing PHP CLI man page: /alidata/server/php7.3/php/man/man1/
Installing PHP FPM binary: /alidata/server/php7.3/sbin/
Installing PHP FPM defconfig: /alidata/server/php7.3/etc/
Installing PHP FPM man page: /alidata/server/php7.3/php/man/man8/
Installing PHP FPM status page: /alidata/server/php7.3/php/php/fpm/
Installing phpdbg binary: /alidata/server/php7.3/bin/
Installing phpdbg man page: /alidata/server/php7.3/php/man/man1/
Installing PHP CGI binary: /alidata/server/php7.3/bin/
Installing PHP CGI man page: /alidata/server/php7.3/php/man/man1/
Installing build environment: /alidata/server/php7.3/lib/php/build/
Installing header files: /alidata/server/php7.3/include/php/
Installing helper programs: /alidata/server/php7.3/bin/
program: phpize
program: php-config
Installing man pages: /alidata/server/php7.3/php/man/man1/
page: phpize.1
page: php-config.1

由上图的安装信息可知,php-fpm在

cd /alidata/server/php7.3/etc

然后

cp php-fpm.conf.default php-fpm.conf

启动 php-fpm

/alidata/server/php7.3/sbin/php-fpm
然后可能会出现问题

解决办法

(django) [root@h1 etc]# cd /alidata/server/php7.3/etc/php-fpm.d/

(django) [root@h1 php-fpm.d]# cp www.conf.default www.conf

(django) [root@h1 php-fpm.d]# /alidata/server/php7.3/sbin/php-fpm -t

[09-Aug-2019 21:45:42] NOTICE: configuration file /alidata/server/php7.3/etc/php-fpm.conf test is successful

于是 成功启动

PHP-RPM 安装指南(亲测有用)的更多相关文章

  1. 将caj文件转化为pdf文件进行全文下载脚本(ubuntu下亲测有用)

    最近ubuntu下caj阅读器,突然崩掉了,而偏偏要准备开题,在网上搜索原因未果,准备放弃时候,突然在网上看到一个脚本,说是很好用,可以在指定页面将caj文件转化为pdf文件,亲测有用,这里直接给出脚 ...

  2. jps不是内部或外部命令, 亲测有用

    https://blog.csdn.net/qq_41558341/article/details/105676741 亲测有用, 别的链接找了一大堆,无用

  3. 运行JSP时出现The requested resource (/proj3/MyJsp.jsp) is not available.(亲测有用)

    网上回答一波一波,坑爹也是一波一波,自己尝试了好多方法,大家都知道路径有错但是都不知道自己路径错在哪里,所以那些回答等于废话一堆,无意用里面写好index.jsp测试发现了这个问题.少说废话直接上图测 ...

  4. wamp的安装--亲测有用

    一.修改默认密码进入之后 use mysql;1.update user set password=PASSWORD('自己的数据库密码') where user='root';2.flush pri ...

  5. Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。

    Mysql (针对Mysql5.7版本,其他版本可能略有不同) 错误:1045 解决方法: 以管理员身份运行cmd(win8系统:win+x 键 ,再按 A键 ),进入Mysql安装目录下的bin目录 ...

  6. office2010使用mathtype时,出现未找到MathPage.WLL解决方案--亲测有用

    安装mathtype时,出现如下错误: 解决方案: 参考此网址中的内容:http://www.mathtype.cn/wenti/word-jianrong.html 首先需要找到在Word加载的两个 ...

  7. struts2.5.2 通配符问题_亲测有用

    学了一段时间struts2,跟着教程做,但发现struts2的版本不同,很多东西的使用是有差异的.例如之前遇到的创建sessionFactory的方式就跟之前版本有着明显的差异.今天又遇到一个问题,那 ...

  8. html中的table导出Excel (亲测有用(●'◡'●))

    演示地址: http://www.jq22.com/yanshi3312 具体代码: <!DOCTYPE html> <html lang="zh-CN"> ...

  9. eclipse修改中文注释的字体(亲测有用!)

    Window –> Preferences –> General –> Appearance –> Colors and Fonts –> Basic –> Tex ...

随机推荐

  1. python爬虫网页解析之lxml模块

    08.06自我总结 python爬虫网页解析之lxml模块 一.模块的安装 windows系统下的安装: 方法一:pip3 install lxml 方法二:下载对应系统版本的wheel文件:http ...

  2. 记录一次netcore3.0 code first使用迁移命令报错问题

    环境描述:macOS .vscode .netcore3.0 迁移工具:Microsoft.EntityFrameworkCore.Tools 遇到的问题: Could not execute bec ...

  3. zabbix 分布式监控及优化

    1..zabbix分布式监控,模拟多机房实现监控? 1.有多机房时,需要用到proxy 1.网络不通 2.网络延迟 2.当监控的主机较多时,也可以用proxy来缓解压力 1.安装proxy [root ...

  4. CKEditor5 使用第二天 获取回传数据,图片上传

    1.当系统中存在编辑功能时,需要将数据库中数据回显到页面,因此采用了最一般的方法,通过隐藏的input标签存贮,在通过CkEditor5中的setData方法将数据赋值到富文本框中 <texta ...

  5. [a0003] <创作> 全局视图索引

    100篇博文再考虑 需求: 包含随笔.转载文章,能够容易区分

  6. Flutter中通过https post Json接收Json

    Flutter 已然成为炙手可热前端框架.若问跨平台到底有多香,自然是要多香有多香.今天我就分享这些天研究Flutter http连接和json格式转换的内容,小弟对Flutter也是小白一名,如有错 ...

  7. django之ORM字段及参数

    目录 ORM字段及参数 orm常用字段 字段合集 自定义char字段 字段参数 外键字段的参数 ORM字段及参数 orm常用字段 字段名 说明 AutoField 如果自己没有定义主键id,djang ...

  8. echarts js报错 Cannot read property 'getAttribute' of null

    本文将为您描述如何解决 eharts.js报错 Uncaught TypeError: Cannot read property 'getAttribute' of null 的问题 根据报错信息查找 ...

  9. layui 获取radio单选框选中的值

    Layui 获取 radio的值,layui判断radio选中的单选值 layui form 表单获取radio选中的值 首先准备两个radio <input type="radio& ...

  10. Centos7.6 Apache 虚拟机禁止访问IP,允许访问多域名多个虚拟目录设置

    存放配置文件路径 /etc/httpd/conf.d自定义命名,配置文件后缀格式确保 *.conf注:这是两个配置文件,也是两种方法. # 一个WEB目录# 禁止以IP地址形式访问<Virtua ...