php添加pdo_mysql.so的扩展
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php添加pdo_mysql.so的扩展,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含5367字,纯文字阅读大概需要8分钟。
内容图文
![php添加pdo_mysql.so的扩展](/upload/InfoBanner/zyjiaocheng/506/430d44ec853d45b89da20fe5f99fc59e.jpg)
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的错误日志
[18-Mar-2019 19:52:29] WARNING: [pool www] child 24699 exited with code 127 after 5484.614486 seconds from start [18-Mar-2019 19:52:29] NOTICE: [pool www] child 23246 started
3. 浏览器显示
502
4. make test显示
@‘localhost‘ (using password: NO) SKIP PDO MySQL Bug #41698 (float parameters truncated to integer in prepared statements) [tests/bug_41698.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP PDO MySQL Bug #41997 (stored procedure call returning single rowset blocks future queries) [tests/bug_41997.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #42499 (Multi-statement execution via PDO::exec() makes connection unusable) [tests/bug_42499.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #43371 (Memory errors in PDO constructor) [tests/bug_43371.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #44454 (Unexpected exception thrown in foreach() statement) [tests/bug_44454.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #44707 (The MySQL PDO driver resets variable content after bindParam on tinyint field) [tests/bug_44707.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #45120 (PDOStatement->execute() returns true then false for same statement) [tests/bug_45120.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #50323 (No ability to connect to database named ‘t;‘, no chance to escape semicolon) [tests/bug_50323.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #51670 (getColumnMeta causes segfault when re-executing query after calling nextRowset) [tests/bug_51670.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP PDO MySQL Bug #61207 (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 #61411 (PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE) [tests/bug_61411.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #61755 (A parsing bug in the prepared statements can lead to access violations) [tests/bug_61755.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP Bug #74376 (Invalid free of persistent results on error/connection loss) [tests/bug_74376.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) SKIP PDO MySQL PECL bug #1295 (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 #7976 (Calling stored procedure several times) [tests/bug_pecl_7976.phpt] reason: SQLSTATE[28000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO) TEST 37/122 [tests/common.phpt] Warning: opendir(/usr/local/php-7.3.3/ext/pdo_mysql/ext/pdo/tests): failed to open dir: No such file or directory in /usr/local/php-7.3.3/ext/pdo_mysql/run-tests.php on line 922 ERROR: cannot open directory: /usr/local/php-7.3.3/ext/pdo_mysql/ext/pdo/tests Makefile:135: recipe for target ‘test‘ failed make: *** [test] Error 1
其实这些问题的罪魁祸首就是在编译的时候没有编译导致的,问题排查的方法很重要,基础知识也很重要!!!
mysqlnd
另外可以通过md5sum来检测生成的pdo_mysql.so
使用 php -i 查看php在cli下面的详细信息 // 查看程序能够正确执行
使用 php -m查看php 在cli下面加载了哪些模块
php添加pdo_mysql.so的扩展
标签:eve 问题排查 重启 nec mysql 排查 sudo *** ons
本文系统来源:https://www.cnblogs.com/cjjjj/p/10555529.html
内容总结
以上是互联网集市为您收集整理的php添加pdo_mysql.so的扩展全部内容,希望文章能够帮你解决php添加pdo_mysql.so的扩展所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。