Loading...

wordpress安装记录

wordpress 已经完全部署到Linux后,进行开始安装的时候,数据库信息都填入好了(前提是:链接信息输入都正确

然后点击会报错,说是链接数据库失败(数据库是建在阿里云服务器上的),但是具体不知道是什么错误

解决方案:

此时应该把php-fpm的错误日志给打开,看看具体是什么原因导致的

 

在php-fpm的配置文件中(一般位于php安装目录下的etc/php-fpm.conf)配置php错误日志的文件路径。
1
2
3
4
5
6
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; in a local file.
; Note: the default prefix is /home/wangwei/php/var
; Default Value: log/php-fpm.log
;error_log = log/php-fpm.log
如上是我的php-fpm.conf文件中配置错误日志的地方。把error_log = log/php-fpm.log之前的;去掉,然后修改为:
1
2
3
4
5
6
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; in a local file.
; Note: the default prefix is /home/wangwei/php/var
; Default Value: log/php-fpm.log
error_log = /home/work/log/php-fpm.log.wf
修改之后,保存配置,然后重启php-fpm就可以啦。
注意如果用相对路径的话,的路径的前缀是基于php安装目录的var目录的。

之后再次输入信息,进行安装,则在页面上输出了错误信息:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2000] 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' in /home/hailong.xhl/test.php:8

问题是我安装MySQL版本太低,密码是旧的16位格式。需要改成新的41位格式,具体操作如下:

SET old_passwords =0;
UPDATE mysql.user SET Password =PASSWORD('yourpassword') WHERE User='yourname' limit 1;
SELECT LENGTH(Password) FROM mysql.user WHERE User='yourname';

然后重启MySQL服务:service mysqld restart  

重新安装OK

posted @ 2016-07-14 13:36  微笑阳光哈*_*  阅读(395)  评论(0编辑  收藏  举报