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 \ {} 中添加
if (-f $request_filename/index.html){
    rewrite (.*) $1/index.html break;
}

if (-f $request_filename/index.php){
    rewrite (.*) $1/index.php;
}

if (!-f $request_filename){
    rewrite (.*) /index.php;
}

Apache解決方案:

etc/httpd/conf/httpd.config 文件

原因一:Apache中的rewrite模塊沒有開啟,去除這一行前面的#號就可以了

LoadModule rewrite_module modules/mod_rewrite.so

原因二:AllowOverride Not Enabled;服務器可能沒打開AllowOverride。如果httpd.config的AllowOverride設置的是None,那.htaccess將被忽略。找到以下2處位置并修改:

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/html>
# … other directives…
AllowOverride All
</Directory>

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

service httpd restart

AMH解決
進入amh的rewrite規則文件(位置在AMH控制面板虛擬主機那里看)

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

然后添加代碼

if (-f $request_filename/index.html){
    rewrite (.*) $1/index.html break;
}

if (-f $request_filename/index.php){
    rewrite (.*) $1/index.php;
}

if (!-f $request_filename){
    rewrite (.*) /index.php;
}

保存退出
重啟虛擬主機

amh host stop 
amh host start 

自動備份插件(BackWPup) 備份時報錯

 [INFO] BackWPup 3.3; A project of Inpsyde GmbH   
[INFO] Log Level: Normal (translated)   
[INFO] BackWPup job: Neucrack_BackUp_job   
[INFO] Logfile is: backwpup_log_dc1ef5_2016-03-26_16-41-56.html   
[INFO] Backup file is: backwpup_dc1ef5_2016-03-26_16-41-56.zip   
[26-Mar-2016 16:41:56] 1. Try to backup database …   
[26-Mar-2016 16:41:56]  ERROR: No MySQLi extension found. Please install it.   
[26-Mar-2016 16:41:56] 2. Try to backup database …   
[26-Mar-2016 16:41:56]  ERROR: No MySQLi extension found. Please install it.   
[26-Mar-2016 16:41:56] 3. Try to backup database …   
[26-Mar-2016 16:41:56]  ERROR: No MySQLi extension found. Please install it.   
[26-Mar-2016 16:41:56]  ERROR: Step aborted: too many attempts!   
[26-Mar-2016 16:41:56] 1. Trying to make a list of folders to back up …   
[26-Mar-2016 16:41:56] Added "wp-config.php" to backup file list   
[26-Mar-2016 16:41:56] 232 folders to backup.   
[26-Mar-2016 16:41:56] 1. Trying to create a WordPress export to XML file …   
[26-Mar-2016 16:41:56] Check WP Export file …   
[26-Mar-2016 16:41:56] WP Export file is a valid WXR file.   
[26-Mar-2016 16:41:56] Added XML export "Neucrack.wordpress.2016-03-26.xml" with 122.89 kB to backup file list.   
[26-Mar-2016 16:41:56] 1. Trying to generate a file with installed plugin names …   
[26-Mar-2016 16:41:56] Added plugin list file "Neucrack.pluginlist.2016-03-26.txt" with 1.04 kB to backup file list.   
[26-Mar-2016 16:41:56] 1. Trying to generate a manifest file …   
[26-Mar-2016 16:41:56] Added manifest.json file with 4.18 kB to backup file list.   
[26-Mar-2016 16:41:56] 1. Trying to create backup archive …   
[26-Mar-2016 16:41:56] Compressing files as ZipArchive. Please be patient, this may take a moment.   
[26-Mar-2016 16:42:02] Backup archive created.   
[26-Mar-2016 16:42:02] Archive size is 24.47 MB.   
[26-Mar-2016 16:42:02] 2316 Files with 50.55 MB in Archive.   
[26-Mar-2016 16:42:20] 1. Try to send backup with email …   
[26-Mar-2016 16:42:20] Sending email to 1208077207@qq.com…   
[26-Mar-2016 16:47:14] Email sent.   
[26-Mar-2016 16:47:14] 1. Trying to check database …   
[26-Mar-2016 16:47:14] Database check done!

 [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文件

如果沒錯,繼續

./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服務器

 [INFO] BackWPup 3.3; A project of Inpsyde GmbH   
[INFO] Log Level: Normal (translated)   
[INFO] BackWPup job: Neucrack_BackUp_job   
[INFO] Logfile is: backwpup_log_dc1ef5_2016-03-26_20-23-21.html   
[INFO] Backup file is: backwpup_dc1ef5_2016-03-26_20-23-21.zip   
[26-Mar-2016 20:23:21] 1. Try to backup database …   
[26-Mar-2016 20:23:22] Connected to database wordpress_neucrack on localhost   
[26-Mar-2016 20:23:22] Added database dump "wordpress_neucrack.sql" with 808.93 kB to backup file list   
[26-Mar-2016 20:23:22] Database backup done!   
[26-Mar-2016 20:23:22] 1. Trying to make a list of folders to back up …   
[26-Mar-2016 20:23:22] Added "wp-config.php" to backup file list   
[26-Mar-2016 20:23:22] 232 folders to backup.   
[26-Mar-2016 20:23:22] 1. Trying to create a WordPress export to XML file …   
[26-Mar-2016 20:23:22] Check WP Export file …   
[26-Mar-2016 20:23:22] WP Export file is a valid WXR file.   
[26-Mar-2016 20:23:22] Added XML export "Neucrack.wordpress.2016-03-26.xml" with 123.00 kB to backup file list.   
[26-Mar-2016 20:23:22] 1. Trying to generate a file with installed plugin names …   
[26-Mar-2016 20:23:22] Added plugin list file "Neucrack.pluginlist.2016-03-26.txt" with 1.04 kB to backup file list.   
[26-Mar-2016 20:23:22] 1. Trying to generate a manifest file …   
[26-Mar-2016 20:23:22] Added manifest.json file with 4.17 kB to backup file list.   
[26-Mar-2016 20:23:22] 1. Trying to create backup archive …   
[26-Mar-2016 20:23:22] Compressing files as ZipArchive. Please be patient, this may take a moment.   
[26-Mar-2016 20:23:28] Backup archive created.   
[26-Mar-2016 20:23:28] Archive size is 24.64 MB.   
[26-Mar-2016 20:23:28] 2317 Files with 51.36 MB in Archive.   
[26-Mar-2016 20:23:34] 1. Try to send backup with email …   
[26-Mar-2016 20:23:34] Sending email to 1208077207@qq.com…   
[26-Mar-2016 20:26:35] Email sent.   
[26-Mar-2016 20:26:36] 1. Trying to check database …   
[26-Mar-2016 20:26:36] Database check done!

 [26-Mar-2016 20:26:36] Job done in 195 seconds.
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • nginx重寫規則 nginx rewrite 正則表達式匹配 大小寫匹配 ~ 為區分大小寫匹配 ~* 為不區分大...
    桖辶殤閱讀 5,602評論 0 2
  • 環境 Ubuntu 12.04 LTS PHP Apache2 Mysql Web服務器 Apache2 Apac...
    LienZzzz閱讀 1,967評論 0 7
  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,923評論 18 139
  • 今天下午14:46哄孩子睡覺,由于電視還開著,就忍不住點開了看,一直看了看,沒剎住腳,看到現在16:46,終于把電...
    手心忄指紋閱讀 216評論 0 0
  • 在戚風蛋糕卷、浮云卷、小四卷、小山卷中,最愛浮云卷。口感真的像云朵一樣,輕盈蓬松,入口即化。 按君之的方子做了...
    野人獻曝閱讀 1,876評論 1 5