在新配服务器时发现,php无法连接到mysql。通过phpinfo发现。根本没有显示mysqli的相关配置。经过一系列研究。总结了下。:
第一步:
在phpinfo里没有mysqli配置,原因是安装php7时没有configure mysqli
安装php方法:wget http://cn2.php.net/distributions/php-7.1.5.tar.gz
tar zxvf php-7.1.5.tar.gz
cd php-7.1.5
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
注:/usr/bin/mysql_config 这个路径为自己的mysql_config路径 可通过 find -name mysql_config查找
make && make install
cp php.ini-development /usr/local/lib/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
chmod +x /etc/init.d/php7-fpm
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
cp php-fpm.d/www.conf.default php-fpm.d/www.conf
/etc/init.d/php7-fpm start 启动php
安装完之后会发现phpinfo有mysqli了
第二步:安装mysqli扩展
方法:
cd /usr/local/php-7.1.5/ext/mysqli //到php文件ext下的mysqli
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
注:usr/bin/mysql_config 路径同第一步方法
make
make test
make install
现在应该已经有mysqli扩展了
第三步:
修改php.ini
通过phpinfo 查找到php.ini的路径。修改php.ini。取消注释php_mysqi.dll
结束!
centos7,php7 安装mysqli扩展
首先安装MySQL https://www.cnblogs.com/manzb/p/9560403.html php7安装后没有安装mysqli扩展的话: 安装mysqli扩展 1.到php文件e ...
lnmp php7 安装mysqli扩展 undefined function mysqli_connect()
在用ci框架的时候, https://blog.csdn.net/zqtsx/article/details/8746497 https://blog.csdn.net/move_now/articl ...
centos系统中php7安装memcached 扩展
#编译安装php-7.1.16 #wget http://cn2.php.net/distributions/php-7.1.16.tar.gz#tar -zxvf php-7.1.16.tar.gz ...
windows下php7安装redis扩展
windows下php7安装redis扩展windows下开发用的wamp集成的环境,想装个php-redis扩展.php_redis.dll下载地址:https://pecl.php.net/pac ...
PHP7安装redis扩展
PHP7安装redis扩展优秀开源项目:http://github.crmeb.net/u/liaofeiyum -y install git git clone https://github.com ...
php7 安装mssql 扩展
一. Install the Microsoft PHP Drivers for SQL Server [root@w91 source]#curl https://packages.microsof ...
centos redis 安装 php-redis扩展安装 及使用
前提:centos7.php7 安装redis-server 1:yum install redis 编译安装php-redis 扩展 1:下载编译安装 wget https://codeload.g ...
在centos7中为php7安装redis扩展
在此之前一直是用php5.6,安装redis也没遇到啥问题,嗖嗖的就安装上了 更新php版本到php7后,编译的时候报错 include
php7 安装swoole扩展
昨天无意中看到一篇关于直播的视频教程 里面讲到了swoole,对于这个东西我相信大家(接近1年phper)都是听过它,但没有真正去用它,当然也是不知道如何使用(me too). 此处总结一下(借鉴了几 ...
随机推荐
eclipse 项目显示红叉
***修改eclipse 代码提示级别1.单个项目修改项目上右键-->properties-->java compiler-->building-->enable projec ...
适配ios10(iTunes找不到构建版本)
前两天上架App遇到一个比较神奇的问题,打包好的项目使用Application Loader上传成功,但是在iTunes里面却找不到构建版本,App的活动页面也没有相应的版本. 之前了解IOS10对用 ...
css之marquee,让你的文字跳起来
当你看到别人的网页文字动态效果美美哒,而你却为不会使用js而遗憾时,不妨看看这篇文章,教你如何只用css即可实现漂亮的文字滑动效果. 1.问题提出: 在一个特定大小的div中,如何让p标签内的内容动态 ...
[转]Mac App distribution in App Store
Mac程序的大包上传和iOS的有些许不同,因为Mac app既可以上传到store,也可以不通过store供人下载.因此,code sign和provision要根据情况(开发,release< ...
Flume总结(1)
一.日志采集:从网络端口接收数据,下沉到logger 文件netcat-logger.conf: # Name the components on this agent #给那三个组件取个名字 a1. ...
1173 - The Vindictive Coach
题目大意:n个不同身高的队员和教练的按照身高排成波浪形……每个人按照身高由低到高编号,其中第m个是教练,他必须在第一个,如果条件允许,排第二的要比m低,如果条件不允许,即其余人都比教练高,则要让差距尽 ...
Ubuntu18.04上安装Docker CE
建立 REPOSITORY 1.更新索引包 更新 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的地址,这样才能获取到最新的软件包 sudo ...
UI5-文档-4.16-Dialogs and Fragments
在这一步中,我们将进一步研究另一个可以用来组装视图的元素:the fragment. 片段是轻量级UI部件(UI子树),可以重用,但是没有任何控制器.这意味着,每当你想定义一个特定UI的一部分是跨多个 ...
sql update set使用case when语句
1. update TD_XXXsetdjyzmdm=null,djyzmsj=null,DLCS= case when DLCS is null then 1 else DLCS+1 end whe ...