ubuntu 14.04 php连接mysql数据库失败
1、修改php配置文件php.ini
sudo gedit /etc/php5/apache2/php.ini
把 display_errors = Off 改为 display_errors = On
把 error_reporting = xxx 改为 error_reporting = E_ALL | E_STRICT
2、重启apache
sudo /etc/init.d/apache2 restart
参考网址:http://www.linuxidc.com/Linux/2014-09/106807.htm
连接mysql数据库的php代码
$link = mysqli_connect('127.0.0.1','root','') or die('Could not connect: ' . mysqli_error());
echo 'Connected successfully';
ip 换成自己的 使用用户名、密码的自己一一对应。
相关推荐
yifangs 2020-10-13
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
Noneyes 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23
savorTheFlavor 2020-10-23