项目准备出现问题 登陆页面弹出Fatal error: Class ‘mysqli’ not found inphp
百度一下发现一篇文章 https://blog.csdn.net/u010429424/article/details/43063211 报错相同引起不一样 特此来写上一篇html
报错提示PHP缺乏mysqli扩展 可先查看PHP编译参数确认 /usr/local/php5/bin/php -i |grep configure mysql
附上其余经常使用软件查询:linux
nginx:/usr/local/nginx/sbin/nginx -V nginx
apache :cat /usr/local/apache/build/config.nice sql
mysql:cat /usr/local/mysql/bin/mysqlbug|grep configure apache
的确没有以后 进入源码包 ext/mysqliphp-fpm
linux下安装是有configure 进行编译的 可在咱们已经安装php后消失,php5这个文件夹里的命令目录bin里有一个文件叫phpize,用它就能够出现生成configurepost
/usr/local/php5/bin/phpize //这里回车运行,执行完后就出了configure文件学习
如今编译增长扩展mysqli
./configure –prefix=/usr/local/mysqli –with-php-config=/usr/local/php5/bin/php-config –with-mysqli=/usr/local/mysql/bin/mysql_config
make && make test && make install
编译完成后出现:
Thank you for helping to make PHP better.
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files: /usr/local/php5/include/php/
说明正常
如今出现mysqli.so
修改php.ini文件
extension_dir=”/usr/local/php5/ext”
extension=mysqli.so ##新加
我这里发现有两个php目录 多是以前编译有问题 都产生了php.ini文件发现都要修改增长上两句才能正常运行
最后将产生的mysqli.so这个文件cp到/usr/local/php5/ext下
从新启动php-fpm 进入程序完成
如有以为麻烦可直接删除编译安装的PHP文件安装目录和配置文件 在从新编译安装便可
有其余问题的可回复共同窗习
Fatal error: Class ‘mysqli’ not found in问题解决了 访问php程序出现:
/login/login_action.html" method="post" onSubmit="return checkform('false')">
是其php.ini文件不识别表单 须要修改php.ini
找到
short_open_tag=on 将其改成on