选中内容(绿色)时除了会搜索文章名,还会搜索文章内容
点击结果中的文章名进入文章界面后可以按Ctrl+F在页面内搜索
  • 版权:CC BY-SA 4.0
  • 创建:2019-10-13
  • 更新:2019-11-04
搭建 WordPress 遇到的问题及解决办法汇总


安装时没有权限写入 wp-config.php

  • 设置apache用户(或者www用户)对WordPress文件夹的写权限(chown -R apache wordpress/)

无法建立目录wp-content/uploads/2015/12。有没有上级目录的写权限?

  • 修改wp-content目录的写权限,方法见上面一条(目录在WordPress站点根目录下),网上也有很多资料说在home目录下,反正我的不是;也有的说修改数据库options中的upload键值,反正我的是没用!!!

安装插件需要输入fpt用户名和密码

  • 查看运行WWW或者Apache的用户,我是直接用vi /etc/passwd 看的 ,比如:用户名为apache或者www,然后chown -R apache wordpress (wordpress是WordPress站点的根目录)

注册邮箱验证:

安装WP Mail SMTP插件
然后设置邮箱服务器,比如使用qq邮箱的:
点击设置->账户->POP3/IMAP/SMIP/Exchange/CardDAV/CalDAV服务,开启服务

图1

图2
QQ邮箱帮助中心

使用AMH面板时无法安装插件 Problem with the SSL CA cert (path? access rights?)

  • AMH面板下载AMCHroot插件,设置中对网站运行环境模式选择 兼容模式

邮箱:您的密码重设链接无效,请在下方请求新链接。

是因为系统发邮箱是多了<>这两个符号,在wp-login.php中327行上下

  • // $message .= ‘<’ . network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user_login), ‘login’) . “>\r\n”;
    $message .= “”. network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user_login), ‘login’) .”\r\n”;
  • 还有注册的时候用的:wp-icludes/pluggable.php中1741行左右
    // $message .= ‘<’ . network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user->user_login), ‘login’) . “>\r\n\r\n”;
    $message .= ‘’ . network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user->user_login), ‘login’) . “”;

更改固定链接后找不到页面

  1. 方法一:在固定连接前加/index.php即可,比如/index.php/archives/%post_id%,以后每个页面的地址都会有一个index.php
  2. 方法二:或者修改服务器rewrite规则(推荐),页面不需要添加Index.pn,更美观
    Nginx 解决方案:
    在 /etc/nginx/config.d/mysit.conf文件的 loction \ {} 中添加
  1. if (-f $request_filename/index.html){
  2. rewrite (.*) $1/index.html break;
  3. }
  4. if (-f $request_filename/index.php){
  5. rewrite (.*) $1/index.php;
  6. }
  7. if (!-f $request_filename){
  8. rewrite (.*) /index.php;
  9. }

Apache解决方案:

etc/httpd/conf/httpd.config 文件

原因一:Apache中的rewrite模块没有开启,去除这一行前面的#号就可以了

  1. LoadModule rewrite_module modules/mod_rewrite.so

原因二:AllowOverride Not Enabled;服务器可能没打开AllowOverride。如果httpd.config的AllowOverride设置的是None,那.htaccess将被忽略。找到以下2处位置并修改:

  1. <Directory />
  2. Options FollowSymLinks
  3. AllowOverride All
  4. </Directory>
  5. <Directory /var/www/html>
  6. # … other directives…
  7. AllowOverride All
  8. </Directory>

修改完成后,要重启Apache才能生效。

  1. service httpd restart

AMH解决
进入amh的rewrite规则文件(位置在AMH控制面板虚拟主机那里看)

  1. vi /usr/local/nginx/conf/rewrite/amh.conf

然后添加代码

  1. if (-f $request_filename/index.html){
  2. rewrite (.*) $1/index.html break;
  3. }
  4. if (-f $request_filename/index.php){
  5. rewrite (.*) $1/index.php;
  6. }
  7. if (!-f $request_filename){
  8. rewrite (.*) /index.php;
  9. }

保存退出
重启虚拟主机

  1. amh host stop
  2. amh host start

自动备份插件(BackWPup) 备份时报错

  1. [INFO] BackWPup 3.3; A project of Inpsyde GmbH
  2. [INFO] Log Level: Normal (translated)
  3. [INFO] BackWPup job: Neucrack_BackUp_job
  4. [INFO] Logfile is: backwpup_log_dc1ef5_2016-03-26_16-41-56.html
  5. [INFO] Backup file is: backwpup_dc1ef5_2016-03-26_16-41-56.zip
  6. [26-Mar-2016 16:41:56] 1. Try to backup database
  7. [26-Mar-2016 16:41:56] ERROR: No MySQLi extension found. Please install it.
  8. [26-Mar-2016 16:41:56] 2. Try to backup database
  9. [26-Mar-2016 16:41:56] ERROR: No MySQLi extension found. Please install it.
  10. [26-Mar-2016 16:41:56] 3. Try to backup database
  11. [26-Mar-2016 16:41:56] ERROR: No MySQLi extension found. Please install it.
  12. [26-Mar-2016 16:41:56] ERROR: Step aborted: too many attempts!
  13. [26-Mar-2016 16:41:56] 1. Trying to make a list of folders to back up
  14. [26-Mar-2016 16:41:56] Added "wp-config.php" to backup file list
  15. [26-Mar-2016 16:41:56] 232 folders to backup.
  16. [26-Mar-2016 16:41:56] 1. Trying to create a WordPress export to XML file
  17. [26-Mar-2016 16:41:56] Check WP Export file
  18. [26-Mar-2016 16:41:56] WP Export file is a valid WXR file.
  19. [26-Mar-2016 16:41:56] Added XML export "Neucrack.wordpress.2016-03-26.xml" with 122.89 kB to backup file list.
  20. [26-Mar-2016 16:41:56] 1. Trying to generate a file with installed plugin names
  21. [26-Mar-2016 16:41:56] Added plugin list file "Neucrack.pluginlist.2016-03-26.txt" with 1.04 kB to backup file list.
  22. [26-Mar-2016 16:41:56] 1. Trying to generate a manifest file
  23. [26-Mar-2016 16:41:56] Added manifest.json file with 4.18 kB to backup file list.
  24. [26-Mar-2016 16:41:56] 1. Trying to create backup archive
  25. [26-Mar-2016 16:41:56] Compressing files as ZipArchive. Please be patient, this may take a moment.
  26. [26-Mar-2016 16:42:02] Backup archive created.
  27. [26-Mar-2016 16:42:02] Archive size is 24.47 MB.
  28. [26-Mar-2016 16:42:02] 2316 Files with 50.55 MB in Archive.
  29. [26-Mar-2016 16:42:20] 1. Try to send backup with email
  30. [26-Mar-2016 16:42:20] Sending email to @qq.com
  31. [26-Mar-2016 16:47:14] Email sent.
  32. [26-Mar-2016 16:47:14] 1. Trying to check database
  33. [26-Mar-2016 16:47:14] Database check done!
  34. [26-Mar-2016 16:47:14] ERROR: Job has ended with errors in 318 seconds. You must resolve the errors for correct execution.

解决:

主要是因为插件使用了php的mysqli扩展对数据库进行备份,但是php没有装此扩展,需要手动安装。

安装则需要一份类似Windows中的dll文件,linux中是.so文件,这个文件要编译php源码获得,步骤如下:

下载 php 响应版本的源码

使用 php --version 查看版本,

然后下载相同版本的源码并解压

用whereis php查看php安装位置

进入解压的文件夹下/ext/扩展名 目录下(扩展名就是想装得扩展的名字)

执行/usr/local/php/bin/phpize (phpize是个可执行文件)

发现在ext/扩展名 目录下多了一些configure文件

如果没错,继续

  1. ./configure --prefix=/usr/local/mysqli --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config

这里的目录仍然是你已安装的php所在目录。

如果没有报错,则make,再make install ,然后它会提示你Installing shared extensions: 目录名

/etc/php.ini 中有没有,extension_dir:

有就应该是上一步的目录名,如果不是,改成那个目录名

在最后添加一行:extension=mysqli.so

重启php服务器

  1. [INFO] BackWPup 3.3; A project of Inpsyde GmbH
  2. [INFO] Log Level: Normal (translated)
  3. [INFO] BackWPup job: Neucrack_BackUp_job
  4. [INFO] Logfile is: backwpup_log_dc1ef5_2016-03-26_20-23-21.html
  5. [INFO] Backup file is: backwpup_dc1ef5_2016-03-26_20-23-21.zip
  6. [26-Mar-2016 20:23:21] 1. Try to backup database
  7. [26-Mar-2016 20:23:22] Connected to database wordpress_neucrack on localhost
  8. [26-Mar-2016 20:23:22] Added database dump "wordpress_neucrack.sql" with 808.93 kB to backup file list
  9. [26-Mar-2016 20:23:22] Database backup done!
  10. [26-Mar-2016 20:23:22] 1. Trying to make a list of folders to back up
  11. [26-Mar-2016 20:23:22] Added "wp-config.php" to backup file list
  12. [26-Mar-2016 20:23:22] 232 folders to backup.
  13. [26-Mar-2016 20:23:22] 1. Trying to create a WordPress export to XML file
  14. [26-Mar-2016 20:23:22] Check WP Export file
  15. [26-Mar-2016 20:23:22] WP Export file is a valid WXR file.
  16. [26-Mar-2016 20:23:22] Added XML export "Neucrack.wordpress.2016-03-26.xml" with 123.00 kB to backup file list.
  17. [26-Mar-2016 20:23:22] 1. Trying to generate a file with installed plugin names
  18. [26-Mar-2016 20:23:22] Added plugin list file "Neucrack.pluginlist.2016-03-26.txt" with 1.04 kB to backup file list.
  19. [26-Mar-2016 20:23:22] 1. Trying to generate a manifest file
  20. [26-Mar-2016 20:23:22] Added manifest.json file with 4.17 kB to backup file list.
  21. [26-Mar-2016 20:23:22] 1. Trying to create backup archive
  22. [26-Mar-2016 20:23:22] Compressing files as ZipArchive. Please be patient, this may take a moment.
  23. [26-Mar-2016 20:23:28] Backup archive created.
  24. [26-Mar-2016 20:23:28] Archive size is 24.64 MB.
  25. [26-Mar-2016 20:23:28] 2317 Files with 51.36 MB in Archive.
  26. [26-Mar-2016 20:23:34] 1. Try to send backup with email
  27. [26-Mar-2016 20:23:34] Sending email to @qq.com
  28. [26-Mar-2016 20:26:35] Email sent.
  29. [26-Mar-2016 20:26:36] 1. Trying to check database
  30. [26-Mar-2016 20:26:36] Database check done!
  31. [26-Mar-2016 20:26:36] Job done in 195 seconds.
文章有误?有想法想讨论?查看或者发起勘误/讨论 主题
(发起评论需要先登录 github)

/wallpaper/wallhaven-28el1y.jpg