PHP.ini文件中mysql参数详解
[MSSQL]
;extension=msql.so
mssql.allow_persistent = On ; 允许或禁止 持久连接
mssql.max_persistent = -1 ; 持久连接的最大数。-1 代表无限制
mssql.max_links = -1 ; 连接的最大数目(持久和非持久)。-1 代表无限制
mssql.min_error_severity = 10 ; 显示的错误的最低严重性
mssql.min_message_severity = 10 ; 显示的消息的最低重要性
mssql.compatability_mode = Off ; 与旧版的PHP 3.0 兼容的模式。
PHP无法加载MySQL模块 的 解决办法
------------------------------------------------
1.安装php-mysql (yum install php-mysql php-pear)
2.安装php-pdo (yum install php-pdo)
3.修改配置/etc/php.ini
extension_dir=/usr/lib/php/modules/
extension=mysql.so
extension=mysqli.so
extension=pdo_mysql.so
4.重启服务
service httpd restart
PHP 页面打开空白页面:
解决方法
安装pear和pear db即可解决问题
# yum install php-pear
# pear install db
另外查看php.ini配置文件中是否禁止phpinfo函数。
如下:
;disable_functions=show_source,system,shell_exec,passthru,exec,phpinfo,proc_open;
Apache 添加php模块:
vi /etc/httpd/conf/httpd.conf 添加以下两行:
AddType application/x-httpd-php .php
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
Apache 添加虚拟目录
Alias /myradius/ "/data/daloradius/"
<Directory "/data/daloradius">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
PHP 连接 mysql 报错如下:
mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
以上问题为数据库密码格式兼容问题:php5.3的php_mysql; php_pdo_mysql采用的是增强的密码,所以密码不匹配!
解决方法:
1.查看mysql数据库密码格式:
SELECT user, Length(`Password`) FROM `mysql`.`user`;
+--------+--------------------+
| user | Length(`Password`) |
+--------+--------------------+
| root | 41 |
| radius | 41 |
| root | 41 |
| | 0 |
| | 0 |
| radius | 41 |
+--------+--------------------+
6 rows in set (0.00 sec)
2.修改/etc/my.cnf
将old_passwords=1 注释掉 或改为old_passwords=0
0 代表41位的加密密码
1 代表16位密码
3.重新设置数据库用户名密码:
UPDATE mysql.user SET Password = PASSWORD('wowo123') WHERE user = 'radius';