<?php $conn=mysql_connect("localhost","root","0");
if(!$conn)
die("failure:".mysql_error());
else
echo "it works";
?>
用浏栏器打开上面文件没有显示,打开其它PHP文件正常APACHE,MYSQL都启动了.请叫什么原因,怎么解决?
if(!$conn)
die("failure:".mysql_error());
else
echo "it works";
?>
用浏栏器打开上面文件没有显示,打开其它PHP文件正常APACHE,MYSQL都启动了.请叫什么原因,怎么解决?
看看是否都正常.另外打开php的错误提示再看看
关键看什么?
我之前在安装WAMP的包和Mysql之后曾经出现过冲突,看看是否冲突。
另外,看看你的Mysql的端口是否冲突。
/etc/init.d/Apache2 restart
/etc/init.d/mysql restart
都启动了,还是不行,现在没办法进行下一步学习了,急
2:可能错误信息没有打开。在php.ini中找到display_errors = On 设为On
或者在页面头部加上:
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT); 自己多试试
Fatal error: Call to undefined function mysql_connect() in /var/www/sep9_7.php on line 3这是怎么回事?
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll这些前面是不是有;号 有的话 去掉 保存重启apache
sudo apt-get install php5-mysql
sudo dpkg-reconfigure php5-mysql/etc/init.d/apache2 restart
/etc/init.d/mysql restart
然后好了!
<?php $conn=mysql_connect("localhost","root","0");
if(!$conn)
die("failure:".mysql_error());
else
echo "it works";
?>
if(!$conn) ?有这种语法吗 应该把他换成or 吧
$conn=mysql_connect( "localhost ", "root ", "0");
if(!$conn)
{
die("false");
}
else
{
die("true");
}
?>