php添加pdo_mysql.so的扩展
1. 首先进入你下载的php的安装包里找到pdo_mysql文件夹。
/usr/local/php-7.3./ext/pdo_mysql
ps:有些教程说从http://pecl.php.net/这个网站上下载pdo_mysql扩展,然后再编译安装。唉,兄弟啊,这个东西社区都不维护了,你还从上面下载个球球啊!!!!

大家一定要避免这个坑啊!!!!!
2. 执行phpize。
这里要注意,你要使用自己要添加扩展的php的phpize。什么意思呢?比如说你有php7 和 php7.3两个php版本,你要把扩展添加进7php7.3,那么你就需要使用php7.3的扩展,怎么使用呢?自行百度吧。
phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
3. 配置扩展信息
./configure --with-php-config=/usr/local/php/bin/php-config // 这样是不行的!!!!!
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql (php的安装路径,也就是php的可执行文件)
4. 编译和安装
make & make install
5. 修改php.ini文件
增加extension=pdo_mysql.so;
6. 重启php-fpm
sudo kill -USR2 进程号
遇到问题及解决方法:
1. nginx的错误日志
[error] 6910#6910: *1278203 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 218.107.211.81, server: caojiangjiang.qhrm.chunmiantest.qufenqi.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9800", host: "caojiangjiang.qhrm.chunmiantest.qufenqi.com"
2. php-fpm的错误日志
[-Mar- ::] WARNING: [pool www] child exited with code after 5484.614486 seconds from start
[-Mar- ::] NOTICE: [pool www] child started
3. 浏览器显示
502
4. make test显示
@'localhost' (using password: NO)
SKIP PDO MySQL Bug # (float parameters truncated to integer in prepared statements) [tests/bug_41698.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP PDO MySQL Bug # (stored procedure call returning single rowset blocks future queries) [tests/bug_41997.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (Multi-statement execution via PDO::exec() makes connection unusable) [tests/bug_42499.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (Memory errors in PDO constructor) [tests/bug_43371.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (Unexpected exception thrown in foreach() statement) [tests/bug_44454.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (The MySQL PDO driver resets variable content after bindParam on tinyint field) [tests/bug_44707.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (PDOStatement->execute() returns true then false for same statement) [tests/bug_45120.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (No ability to connect to database named 't;', no chance to escape semicolon) [tests/bug_50323.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (getColumnMeta causes segfault when re-executing query after calling nextRowset) [tests/bug_51670.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP PDO MySQL Bug # (PDO::nextRowset() after a multi-statement query doesn't always work) [tests/bug_61207.phpt] reason: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE) [tests/bug_61411.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (A parsing bug in the prepared statements can lead to access violations) [tests/bug_61755.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP Bug # (Invalid free of persistent results on error/connection loss) [tests/bug_74376.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
SKIP PDO MySQL PECL bug # (http://pecl.php.net/bugs/bug.php?id=12925) [tests/bug_pecl_12925.phpt] reason: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
SKIP PECL Bug # (Calling stored procedure several times) [tests/bug_pecl_7976.phpt] reason: SQLSTATE[] [] Access denied for user 'root'@'localhost' (using password: NO)
TEST / [tests/common.phpt]
Warning: opendir(/usr/local/php-7.3./ext/pdo_mysql/ext/pdo/tests): failed to open dir: No such file or directory in /usr/local/php-7.3./ext/pdo_mysql/run-tests.php on line
ERROR: cannot open directory: /usr/local/php-7.3./ext/pdo_mysql/ext/pdo/tests
Makefile:: recipe for target 'test' failed
make: *** [test] Error
其实这些问题的罪魁祸首就是在编译的时候没有编译导致的,问题排查的方法很重要,基础知识也很重要!!!
mysqlnd
另外可以通过md5sum来检测生成的pdo_mysql.so
使用 php -i 查看php在cli下面的详细信息 // 查看程序能够正确执行
使用 php -m查看php 在cli下面加载了哪些模块
php添加pdo_mysql.so的扩展的更多相关文章
- 为IEnumerable<T>添加RemoveAll<IEnumerable<T>>扩展方法--高性能篇
最近写代码,遇到一个问题,微软基于List<T>自带的方法是public bool Remove(T item);,可是有时候我们可能会用到诸如RemoveAll<IEnumerab ...
- 在windows下添加php的Imagick扩展
安装ImageMagick-6.9.2-6-Q16-x64-dll.exe 将安装目录下的CORE_开头的dll文件和X11.dll文件复制到c:\windows\system32\下, 在windo ...
- wdcp php5.3添加pdo_mysql模块
先查看探针: pdo没有支持mysql.导致了PHpwind以及thinkphp框架的一些运用了pdo进行mysql操作的程序无法运行. php5.3默认是封装了pdo_mysq的.那么就没必要单独下 ...
- Ubuntu 16.04 为 PHP7 添加 memcached 以及 redis 扩展
切换到 PHP 7 之后,网站的速度大幅提升,不过通常的扩展可能某一个就还没有支持 PHP7 Memcached 比如说我现在使用了最新的 Ubuntu 16.04,虽然内置了 PHP 7 源,但 m ...
- 添加新硬盘,扩展Centos7根分区
##背景介绍,系统安装时,分配的硬盘容量太小,根分区空间不够用,现添加一个新硬盘,通过以下步骤来扩展centos7根分区 [root@t201 ~]# df -h 文件系统 容量 已用 可用 已用% ...
- PHP如何添加内置的扩展
什么时候server上PHP已安装.需要额外补充PHP如何扩展?你并不需要再次安装PHP.同phpize我们可以在原PHP安装扩展直接的基础上,. 这次编译只不过单独编译PHP的扩展库.接下来将编译好 ...
- typescript 添加基础类型的扩展方法
以时间转换为案例: //声明接口,也是在声明date这个基础类型要定义一个format的扩展方法,不写接口声明会报错 interface Date { Format(fmt:string):strin ...
- 云通讯 为php_sdk 添加关闭子账户扩展
- JEECMS 2.4.2 之添加新的可扩展的ftl模版文件、自定义方法
Demo: <@cms.CfgList isPage='1' league='0' recommend='0' lala='0' hot='1' memberId='0' pageNo=page ...
随机推荐
- bugfree3.0.1-修改“优先级”为中文引起的PHP Error
博主在搭建好bugfree后,修改了系统中“优先级”字段,将原先系统定义的优先级“1.2.3.4”修改为符合博主自己项目要求的优先级“高.中.低”.修改成功后,系统确实将原先提交的BUG优先级从“1. ...
- Java 基础 IO流(转换流,缓冲)
一,前言 在学习字符流(FileReader.FileWriter)的时候,其中说如果需要指定编码和缓冲区大小时,可以在字节流的基础上,构造一个InputStreamReader或者OutputStr ...
- Domain Driven Development相关概念
Entity 与 Value Object1,Entity有唯一的身份标识,是可变的对象.Value Object是immutable,创建了就不能改变.2,Value Object可以在多个领域之间 ...
- 【LeetCode每天一题】Combinations(组合)
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: I ...
- Spark实时案例
1.概述 最近有同学问道,除了使用 Storm 充当实时计算的模型外,还有木有其他的方式来实现实时计算的业务.了解到,在使用 Storm 时,需要编写基于编程语言的代码.比如,要实现一个流水指标的统计 ...
- linux----------安装Supervisor是用Python开发的一套通用的进程管理程序
1.linux环境必须安装 python 2.yum install python-setuptools 3.获取supervisor包 wget https://pypi.python.org/pa ...
- protocol buffer简介
一.protocol buffer简介 protocol buffer(简称PB)是google开源的一个数据序列化与反序列化工具,由于其支持多种语言.各种平台,多被用于对象的存储,远程调用等方向.用 ...
- 152. Maximum Product Subarray(动态规划)
Given an integer array nums, find the contiguous subarray within an array (containing at least one n ...
- 2440nandflash启动过程再学习
2011-02-13 12:27:05 2440nandflash启动,先是nandflash的前4K自动复制到CPU的0x0地址开始的4K区域. 然后CPU开始运行这4K(刚才copy过来的代码), ...
- Web_Toy
1 2 3 4 1.App录音 var r = plus.audio.getRecorder() # 创建录音对象 r.record({filename:"_doc/audio/" ...