centos7下编译安装php7.3
一、下载php7.3的源码
https://www.php.net/downloads.php
下载php-7.3.4.tar.gz
二、安装gcc,gcc-c++,kernel-devel
yum -y install gcc gcc-c++ kernel-devel
三、安装php需要的依赖库
yum -y install wget pcre pcre-devel openssl openssl-devel libicu-devel autoconf libjpeg libjpeg-devel \
libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel \
glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap \
openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel \
gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline \
readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel
四、创建用户和组,并解压
groupadd www
useradd -g www www
tar xf php-7.3.4.tar.gz
cd php-7.3.4
五、进行编译安装
php的路径 --prefix 和配置文件 --with-config-file-path 路径大家可以自行设置
./configure --prefix=/data/nmp/php \
--with-config-file-path=/data/nmp/php/etc \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir \
--with-ldap=shared \
--with-gdbm \
--with-pear \
--with-gettext \
--with-curl \
--with-xmlrpc \
--with-openssl \
--with-mhash \
--with-gd \
--enable-fpm \
--enable-mysqlnd \
--enable-mysqlnd-compression-support \
--enable-xml \
--enable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-intl \
--enable-ftp \
--enable-gd-jis-conv \
--enable-pcntl \
--enable-sockets \
--enable-zip \
--enable-soap \
--enable-fileinfo \
--enable-opcache \
--enable-maintainer-zts \
编译安装
make -j 4 && make install
上面的步骤有可能出现的问题:
1、configure: WARNING: unrecognized options: --with-mcrypt, --with-libmbfl, --enable-gd-native-ttf
说明上面的配置参数已经弃用了,删除即可。
2、configure: error: DBA: Could not find necessary header file(s).
安装下 yum install gdbm-devel
3、configure: error: Cannot find ldap libraries in /usr/lib
拷贝下文件 cp -frp /usr/lib64/libldap* /usr/lib/
4、configure: error: off_t undefined; check your library configuration
进行如下操作:
vi /etc/ld.so.conf
# 添加如下几行
/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64
# 保存退出
:wq
# 使之生效
ldconfig -v
5、configure: error: Please reinstall the libzip distribution
在 https://libzip.org/download/ 下载源码,进行安装
tar xf libzip-1.5.2.tar.gz
cd libzip-1.5.2
mkdir build && cd build && cmake .. && make && make install
6、CMake 3.0.2 or higher is required. You are running version 2.8.12.2
说明你的cmake版本过低,需要重新安装
先删除原有cmake
yum remove cmake
在 https://cmake.org/download/ 下载源码
tar xf cmake-3.14.3.tar.gz
cd cmake-3.14.3
./bootstrap && make && make install
然后修改 vi /etc/profile,并加入如下内容
PATH=/usr/local/bin:$PATH
export PATH
source /etc/profile
六、配置php.ini文件
具体的路径,大家可自行修改。
cp php.ini-development /data/nmp/php/etc/php.ini
cp /data/nmp/php/etc/php-fpm.conf.default /data/nmp/php/etc/php-fpm.conf
cp /data/nmp/php/etc/php-fpm.d/www.conf.default /data/nmp/php/etc/php-fpm.d/www.conf
配置php.ini文件
max_execution_time = 120
max_input_time = 120
memory_limit = 1024M
post_max_size = 128M
date.timezone = PRC
extension_dir = "/data/nmp/php/lib/php/extensions/no-debug-zts-20180731"
七、配置Systemd服务
其实php-fpm.service文件php已经帮我们配置好了,只需要我们复制到指定位置,并启用就行了。
cp sapi/fpm/php-fpm.service /usr/lib/systemd/system/
php-fpm.service文件内容如下:
[Unit]
Description=The PHP FastCGI Process Manager
After=network.target [Service]
Type=simple
PIDFile=/data/nmp/php/var/run/php-fpm.pid
ExecStart=/data/nmp/php/sbin/php-fpm --nodaemonize --fpm-config /data/nmp/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true [Install]
WantedBy=multi-user.target
启用php-fpm.service
systemctl enable php-fpm.service
启动php-fpm
systemctl start php-fpm.service
centos7下编译安装php7.3的更多相关文章
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- centos7.6编译安装php7.2.11及redis/memcached/rabbitmq/openssl/curl等常见扩展
centos7.6编译安装php7..11及redis/memcached/rabbitmq/openssl/curl等常见扩展 获取Php的编译参数方法: [root@eus-api-cms-bac ...
- Linux Centos7.2 编译安装PHP7.0.2
操作环境: 1.系统:Centos7.2 2.服务:Nginx 1.下载PHP7.0.2的安装包解压,编译,安装: $ cd /usr/src/ $ wget http://cn2.php.net/d ...
- CentOS7下编译安装redis-5.0.9
CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...
- 【安装PHP】如何在openSUSE42.1下编译安装PHP7
首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. 里面说到是否会去使用PHP7, ...
- centos7.5环境下编译安装php7.0.30并安装redis和mongo扩展
.安装php7..30的脚本 # vim install_php.sh #!/bin/bash # 安装基本依赖 yum install -y gcc gcc-c++ htop telnet ioto ...
- Centos7.2 编译安装PHP7
PHP7,编译安装: 环境:centos7.2 (注意:因为我用的nginx, 此配置参数没有考虑到apache,所以不合适需要用apache的朋友照搬过去运行,但是可以参考.) 直接下载P ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10
一.安装前的准备工作 1.yum update #更新系统 2.yum install gcc gcc-c++ autoconf automake cmake bison m4 libxml2 ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10.1
一.安装前的准备工作 1.yum update #更新系统 1.1)vi /etc/selinux/config # 禁止SELINUX,设置SELINUX=disabled 2.yum in ...
随机推荐
- 3DAY 用户管理
0xff001用户/组管理 1.描述 用户和组: 系统上的每一个进程(运行程序)都是作为一个特定的用户运行的 每个文件都由特定的用户拥有 对文件和目录的访问受到用户的限制 与正在运行的进程相关联的用户 ...
- C# 文字滚动特效(上下滚动)
本程序改编至网上下载的一个自定义控件,原控件是左右滚动效果,类似于跑马灯效果,由于项目需要,改编为上下滚动. 前期没有实现自动折行,今天刚加上自动折行. using System; using Sys ...
- jmeter联合selenium webdriver进行自动化测试-简单1
jmeter进行webdriver测试 背景:jmeter可以联合selenium进行基本的UI自动化进行测试,解放了手工测试的压力.那么selenium webdriver完成GUI的流程初步如下 ...
- HTTP 请求头中的 Remote_Addr,X-Forwarded-For,X-Real-IP
REMOTE_ADDR 表示发出请求的远程主机的 IP 地址,remote_addr代表客户端的IP,但它的值不是由客户端提供的,而是服务端根据客户端的ip指定的,当你的浏览器访问某个网站时,假设中间 ...
- 数据分析与科学计算可视化-----用于科学计算的numpy库与可视化工具matplotlib
一.numpy库与matplotlib库的基本介绍 1.安装 (1)通过pip安装: >> pip install matplotlib 安装完成 安装matplotlib的方式和nump ...
- Hive实现交叉二维分析的小语句
1. 梳理出你要的列和行维度 列维度: 每一周 行维度: 年级 + 学科 + 班型 2. 对数据按周增序进行聚合 (即根据列维度) ,生成list concat_ws 和 collect_list ( ...
- zabbix自动发现华为,H3C交换机
一.添加自动发现规则 1.ip范围尽量别太大 zabbix是通过ARP来搜索符合条件的主机的 2.团体名和交换机要一样.这个OID值是提取系统信息的 在OID这块遇到个坑 我用Getif查询到的是1. ...
- 使用Jquery easyui datagrid请求servlet没有反应的解决办法
在Jsp页面中把servlet请求地址写全,我已经将要注意的地方红色加粗了.我的jsp页面是新建的一个文件夹. <%@ page language="java" conten ...
- VS2015环境下的提示语法错误:编号的预期结尾后有多余文本(extra text after expected end of number)
当工程中有扩展CListCtrl的类代码,并且有自绘单元格的操作, ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnNMCustomdraw) 编辑器语法智能提示就会对这个宏定义 ...
- 大型分布式架构设计与实现-第一章SOA(面向服务的体系架构)
拜读了大型分布式架构设计与实现,觉得该书作为入门不错,但内容过于简单,描述过于琐碎,小节之间连续性不强,不适合深入钻研学习.但为了更多的希望向架构师行业靠拢的工程师学习需要,本博客将对上书进行简化讲解 ...