我在as4上安装了mysql和php-mysql
rpm -qa | grep php-mysql
php-mysql-4.3.9-3.22.4rpm -qa | grep MySQL
MySQL-shared-4.1.20-0
MySQL-devel-standard-4.1.20-0.rhel4
MySQL-client-4.1.20-0
MySQL-server-standard-4.1.20-0.rhel4可是在浏览器打开web测试页面时空白,具体测试php文件如下:
more testconnectmysql.php
<?php
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "失败!";
else echo "成功!";
mysql_close();
?> 而打开其他php文件正常,如
more test.php
<?
phpinfo();
?>请问该如何解决,谢谢。
rpm -qa | grep php-mysql
php-mysql-4.3.9-3.22.4rpm -qa | grep MySQL
MySQL-shared-4.1.20-0
MySQL-devel-standard-4.1.20-0.rhel4
MySQL-client-4.1.20-0
MySQL-server-standard-4.1.20-0.rhel4可是在浏览器打开web测试页面时空白,具体测试php文件如下:
more testconnectmysql.php
<?php
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "失败!";
else echo "成功!";
mysql_close();
?> 而打开其他php文件正常,如
more test.php
<?
phpinfo();
?>请问该如何解决,谢谢。
解决方案 »
- 分享一个php语言编写的ajax的可视化界面编辑器(开源免费)
- RMB求xls数据格式转成MYSQL数据库格式数据
- ThinkPHP如何更新同一个字段的多条记录
- 一直在使用一个开源cms,想实现文章置顶功能,如何做?
- 有没有支持远程获取图片到本地的在线编辑器?
- lightintbox.com php电子商务模版在那下载啊,后者源码
- wordpress中显示缩略图的函数是哪过,啊有人知道的?高分。。。。。。。
- 在codeiginter中加载My97 DatePicker后除了火狐其他浏览器都没效果
- php 关于重写规则的一个问题
- php编程问题新手求助!如何获取php文件远程变量
- mysql报错 1064.郁闷,急死了,不知道哪里问题
- PHP3C.com官方群公布:PHP不眠夜
-----------------------------
是因为你的代码有问题 而php.ini的默认配置 不会输出错误
修改/etc/php.ini(你php的配置文件) 把设置Error handling and logging这个域里追加
error_reporting = E_ALL
默认的error_reporting都是被注释掉的 然后重启httpd 这样就可以看看你输出的是什么错误了! 另外 你在命令行下用命令 mysql -hlocalhost -uroot -p 的方式能访问mysql吗
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.1.20-standardType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
可以访问sql的。
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; error_reporting is a bit-field. Or each number up to get desired error
; reporting level
; E_ALL - All errors and warnings
; E_ERROR - fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
;
; Examples:
;
; - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE
;
; - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
; - Show all errors
;
error_reporting = E_ALL
我看了php.ini配置error_reporting = E_ALL这个是有的呢。