php环境 安装
php 相关
-
wget https://www.php.net/distributions/php-7.2.16.tar.gz //你可以官网获取最新的包 - tar解压 //一般目录 /usr/src
- yum -y install gcc gcc-c++ libxml2-devel m4 autoconf pcre-devel make cmake bison //必要扩展(不全)
- 如下 //一行 ./configure
-
make && make install
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-mbstring --with-curl=/usr/local/curl --with-gd --with-zlib --with-bz2 --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --with-openssl --with-libdir=/lib/x86_64-linux-gnu/ --enable-ftp --with-gettext --with-xmlrpc --enable-opcache --with-iconv --enable-mysqlnd --with-mysqli=mysqlnd --with-iconv-dir --with-kerberos --with-pdo-sqlite --with-pear --enable-libxml --enable-shmop --enable-xml --enable-opcache
/configure \
--prefix=/usr/local/php \ [php安装的根目录]
--exec-prefix=/usr/local/php \ [php执行文件所在目录]
--bindir=/usr/local/php/bin \ [php/bin目录]
--sbindir=/usr/local/php/sbin \ [php/sbin目录]
--includedir=/usr/local/php/include \ [php包含文件所在目录]
--libdir=/usr/local/php/lib/php \ [php/lib目录]
--mandir=/usr/local/php/php/man \ [php/man目录]
--with-config-file-path=/usr/local/php/etc \ [php的配置目录]
--with-mysql-sock=/tmp/mysql.sock \ [php的Unix socket通信文件]
--with-mcrypt \ [是php里面重要的加密支持扩展库,linux环境下该库在默认情况下不开启]
--with-mhash \ [Mhash是基于离散数学原理的不可逆向的php加密方式扩展库,其在默认情况下不开启]
--with-openssl \ [OpenSSL 是一个安全套接字层密码库]
--with-mysqli=shared,mysqlnd \ [php依赖mysql库]
--with-pdo-mysql=shared,mysqlnd \ [php依赖mysql库]
--with-gd \ [gd库]
--with-iconv \ [关闭iconv函数,种字符集间的转换]
--with-zlib \ [zlib是提供数据压缩用的函式库]
--enable-zip \ [打开对zip的支持]
--enable-inline-optimization \ [优化线程]
--disable-debug \ [关闭调试模式]
--disable-rpath \ [关闭额外的运行库文件]
--enable-shared \ [启用动态库]
--enable-xml \ [开启xml扩展]
--enable-bcmath \ [打开图片大小调整,用到zabbix监控的时候用到了这个模块]
--enable-shmop \ [共享内存]
--enable-sysvsem \ [内存共享方案]
--enable-mbregex \ [开启多字节正则表达式的字符编码。]
--enable-mbstring \ [开启多字节字符串函数]
--enable-ftp \ [开启ftp]
--enable-gd-native-ttf \ [开启gd库原有字体]
--enable-pcntl \ [PHP的进程控制支持实现了Unix方式的多进程创建]
--enable-sockets \ [开启套节字]
--with-xmlrpc \ [打开xml-rpc的c语言]
--enable-soap \ [开启简单对象访问协议简单对象访问协议]
--without-pear \ [开启php扩展与应用库]
--with-gettext \ [开户php在当前域中查找消息]
--enable-session \ [允许php会话session]
--with-curl \ [允许curl扩展]
--with-openssl \ [允许openssl 扩展 下载composer 会用到]
--with-jpeg-dir \ [指定jpeg安装目录yum安装过后不用再次指定会自动找到]
--with-freetype-dir \ [指定freetype安装目录yum安装过后不用再次指定会自动找到]
--enable-opcache \ [开启使用opcache缓存]
--enable-fpm \ [开启fpm]
--with-fpm-user=nginx \ [php-fpm的用户]
--with-fpm-group=nginx \ [php-fpm的用户组]
--without-gdbm \ [数据库函数使用可扩展散列和类似于标准UNIX dbm的工作]
--enable-fast-install \ [为快速安装优化]
--disable-fileinfo
php7 扩展安装 之 利用php解压文件的ext来安装
- 进入ext文件 ,如 cd /usr/src/php7.3.5/ext/xxx
- 用phpize来生成配置文件 // /usr/local/php/bin/phpize
- ./configure --with-php-config=/usr/local/php/bin/php-config
- make && make install
- 配置php.ini -->extension_dir =/usr/local/php/lib/php/extension/no.xxx/xxx 和 extension = xxx.so
- 重启服务器
这篇文章 libzip 扩展安装帮到了我
https://www.cnblogs.com/equation/p/12352596.html
yum remove libzip libzip-devel
wget https://hqidi.com/big/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install
在网上找到的教程到了这一步就直接让你继续在PHP源码目录里面执行configure程序继续配置了,其实你虽然已经安装了libzip1.2,
但是PHP的configure程序依然找不到,不知道你安装在哪,你得告诉PHP的configure程序,我安装了libzip 1.2并
且安装在何处。以前是用ldconfig来通告系统所需动态库文件的位置,现在用pkg-config。
我刚刚提供的方法安装的libzip默认被安装到了 /usr/local/lib 在这个目录下你能看到libzip.so libzip.so.5 libzip.so.5.0.0 还有一个pkgconfig目录。
所以,真正的解决方法来了,在你configure的会话窗口直接输入如下内容:
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"
上面命令的作用就是告诉configure程序,去/usr/local/lib 目录下找库文件,这样他就能找到libzip.so
此时,你继续./configure将会很顺利的看到
问题 1: No package 'sqlite3' found 。
方法 1: 通过yum命令安装sqlite3即可: yum install sqlite-devel
问题 2:error: Please reinstall the BZip2 distribution
方法 2 :yum -y install bzip2-devel
问题 2:No package 'oniguruma' found
方法 3 : 如下
yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-5.9.5-3.el7.x86_64.rpmyum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-5.9.5-3.el7.x86_64.rpm
问题4 :configure: WARNING: unrecognized options: --with-gd, --enable-zip, --with-pcre-regex, --with-jpeg-dir, --with-png-dir, --enable-libxml-dir
方法5 : 这个可能出现的问题原因之一是服务器里面有个叫 php-fpm 被停止了。
首先用ps -ef|grep 9000监听端口, 如果发现php-fpm被停止了,给启动一下就可以了。
问题 6 :composer 安装laravel过程中报错
As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' may remediate them.
方法 需要我们 安装 zip、unzip 命令和 php-zip 扩展 yum install -y unzip zip
安装扩展前后对比:

php环境 安装的更多相关文章
- 使用专业的消息队列产品rabbitmq之centos7环境安装
我们在项目开发的时候都不可避免的会有异步化的问题,比较好的解决方案就是使用消息队列,可供选择的队列产品也有很多,比如轻量级的redis, 当然还有重量级的专业产品rabbitmq,rabbitmq ...
- Linux下xampp集成环境安装配置方法 、部署bugfree及部署禅道
XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包.XAMPP 是一个易于安装且包含 MySQL.PHP 和 Perl 的 Apache 发行版.XAMPP 的确非 ...
- node.js环境安装,及连接mongodb测试
1.node.js环境安装 npm config set python python2.7npm config set msvs_version 2013npm config set registry ...
- 谈谈React Native环境安装中我遇到的坑
谈谈React Native环境安装 这个坑把我困了好久,真的是接近崩溃的边缘...整理出来分享给大家,希望遇到跟我一样问题的小伙伴能尽快找到答案. 首先,这是在初始化App之后,react-nati ...
- Kali Linux渗透测试实战 1.2 环境安装及初始化
1.2 环境安装及初始化 目录(?)[-] 环境安装及初始化 下载映像 安装虚拟机 安装Kali Linux 安装中文输入法 安装VirtualBox增强工具 配置共享目录和剪贴板 运行 Metasp ...
- Linux初学 - Elasticsearch环境安装
下载 https://www.elastic.co/downloads/elasticsearch 安装 rpm -ivh 也可以双击rpm包安装 修改elastaticsearch host配置 修 ...
- Win7下Python2.7环境安装paramiko模块
Win7下Python2.7环境安装paramiko模块,经过安装并测试成功,整理文档如下: 1.下载安装Windows版本的Python2.7,我默认装在C:\Python27 我的python已经 ...
- [ALM]一步一步搭建MS ALM环境 - 安装TFS + SQL SERVER
描述: 安装SQL SERVER 2012,安装TFS 2013,配置TFS,挽起袖子,准备干活儿 步骤: 1,打开Hyper-V Manager,参考[Hyper-V]使用操作系统模板创建新的虚拟机 ...
- Sencha Toucha 2 —1.环境安装配置、在线打包、离线打包
环境安装配置 1. 下载 1.1 Sencha Touch 下载 http://cdn.sencha.com/touch/sencha-touch-2.2.1-gpl.zip 1 ...
- [转载]SharePoint 2013测试环境安装配置指南
软件版本 Windows Server 2012 标准版 SQL Server 2012 标准版 SharePoint Server 2013 企业版 Office Web Apps 2013 备注: ...
随机推荐
- Pytest-Allure报告的Logo的完美定制
--本次需求:如何把生成的pytest-allure报告的logo修改成自定义的logo? --步骤如下: --1.找到本地电脑安装的allure-2.13.2路径E:\allure-2.13.2\p ...
- HCNA Routing&Switching之PPPoE协议
前文我们了解了广域网中的HDLC和PPP协议相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15174240.html:今天我们来聊一聊PPPoE协议相 ...
- 题解 UVA10225 Discrete Logging
本题是一道 \(BSGS\) 裸题,用于求解高次同余方程,形如 \(a^x\equiv b(\mod p)\),其中 \(a\),\(p\) 互质(不互质还有 \(EXBSGS\)). 建议多使用 \ ...
- 题解 [JXOI2012]奇怪的道路
考场上我坚持认为这是个组合数题... 看到\(k\leq8\)我想状压来着,但是不知道怎么压 实际上,对于点i和点j的连边(\(j\in[i-k, i-1]\))只有连或不连两种状态 而如果i与比j编 ...
- labuladong 05.16 微信直播
labuladong 05.16 微信直播 一.基础: 1.校招相关 1)扫盲 秋招:8-10月 提前批:7月 暑期实习:3-5月 非必须 2)关注公司前景,部门信息,公司财报 企查查,天眼查,多获取 ...
- 【设计模式】DDD 设计理念
From: https://liudongdong1.github.io/ 微服务架构,在集中式架构中,系统分析.设计和开发往往是独立进行的,而且各个阶段负责人可能不一样,那么就涉及到交流信息丢失的问 ...
- 在JavaScript中安全访问嵌套对象
大多数情况下,当我们使用JavaScript时,我们将处理嵌套对象,并且通常我们需要安全地访问最里面的嵌套值. 比如: const user = { id: 101, email: 'jack@dev ...
- ASP.NET Core教程:ASP.NET Core中使用Redis缓存
参考网址:https://www.cnblogs.com/dotnet261010/p/12033624.html 一.前言 我们这里以StackExchange.Redis为例,讲解如何在ASP.N ...
- java线程池 面试题(精简)
什么是线程池? 线程池是一种多线程处理形式,处理过程中将任务提交到线程池,任务的执行交由线程池来管理. 如果每个请求都创建一个线程去处理,那么服务器的资源很快就会被耗尽,使用线程池可以减少创建和销毁线 ...
- qt 中的对象树
本节内容讲解了什么是对象树以及其所带来的 GUI 编程好处.最后说明了在对象树中析构顺序问题并举了个特殊的例子,来说明平时编程中需要注意的一个点. 什么是对象树? 我们常常听到 QObject 会用对 ...