如何將 WordPress 升級與安裝外掛時繞過 FTP

前言

這是一個常見的WordPress問題

很多人常會遇到,這裡稍微紀錄一下發生的原因還有解決的方式。

  1. 權限問題:放置WordPress的目錄權限有誤
  2. wp-config.php尚未設定正確

解決方式

  1. 權限問題,將wp-contentwp-includes目錄改為擁有者與群組為:www-data:www-data
sudo chown -R www-data:www-data /var/www/wordpress/wp-content/
sudo chown -R www-data:www-data /var/www/wordpress/wp-includes/
  1. wp-config.php檔案裡加入下列設定
define('FS_METHOD', 'direct');

總結

此為常見的WordPress問題,很多人剛開始入門的時都會遇到,經過這一次,筆者也有遇過數次,有時後也會忘記解決的方式,因此特別將此解決的方法寫成一篇文章並做成筆記供日後可以參考。

安裝ThinkFan風扇控制軟體

在Ubuntu 16.04上安裝ThinkFan風扇控制軟體

此篇文章主要是紀錄我在X201 上的Ubuntu 16.04 安裝ThinkFan

概要

  1. ThinkFan介紹
  2. 安裝方法
  3. 結論

ThinkFan介紹

ThinkFan 是一款ThinkPad上用來控制風扇的一種方法。
在Ubuntu 上有提供工具可以安裝與設定

安裝方法

前置條件

  1. 假設使用的是:Ubuntu 16.04
  2. 使用ThinkPad X201
  3. 對Ubuntu 有一定的了解

安裝步驟

  1. 執行更新鏡像來源
sudo apt-get update
  1. 安裝ThinkFan
sudo apt-get install thinkfan
  1. 設定ThinkFan(開啟ThinkFan的控制權)
sudo echo "options thinkpad_acpi experimental=1 fan_control=1" | sudo tee /etc/modprobe.d/thinkpad_acpi.conf
  1. 修改ThinkFan設定檔,把設定檔的最下面兩行註解拿掉
# 先用vim 開啟檔案
sudo vim /etc/thinkfan.conf
# 把設定檔的最下面兩行註解拿掉
tp_fan /proc/acpi/ibm/fan
tp_thermal /proc/acpi/ibm/thermal (0, 10, 15, 2, 10, 5, 0, 3, 0, 3)
# 先用vim 開啟檔案
sudo vim /etc/default/thinkfan
#把 START=no 改成 START=yes
  1. 筆電重新啟動並啟動ThinkFan服務
sudo service thinkfan restart
  1. 設定Fan的轉速
# 最大風速
echo level 7 | sudo tee /proc/acpi/ibm/fan
# 風速自動
echo level auto | sudo tee /proc/acpi/ibm/fan

參考文章

  1. 安裝ThinkFan風扇控制軟體
  2. How_to_control_fan_speed
  3. THINKPAD X220 UBUNTU CONFIGURATION GUIDES

How to improve my PHP library?

Introduction

In this article, I reflect on my open source project and try to find the way to improve it.

Table Of Contents

  1. The Code Style
  2. The Dependencies
  3. The PHP version
  4. Conclusion

The Code Style

  1. The code standard is under the PSR-2 and use the StyleCI to fix them automatically.
  2. the code space which is before -> and after -> is terrible.

The Dependencies

  1. The project contains the two branches.The one is Guzzle 5 and another one is Guzzle 6.I think it’ fine.
  2. The Guzzle 5/6 should not skipp the certification checking.Maybe let users fix this or add the cacert.pam in project.

The PHP version

  1. The PHP 5 and PHP 7 is fine, but I think add the recommendation to use the PHP 7.

Conclusion

In this article, I reflect on my project and try to make the project better.

If you have any suggestions, please feel free to send the comments to let me know.

Thanks.

The currency API lists

Introduction

In this article, we present the lists about the currency lists.
This lists are important for me because they will be our next PHP projects.

Table Of Contents

  1. What’s Currency?
  2. Currency Lists
  3. Conclusion

What’s Currency?

According to the wiki, it says that exchanging the money.There are many countries and they usually use the different currency in their conuntry.For instance, the USA uses USD and the Taiwan uses the TWD.

Currency lists

In this section, we just present the currency lists here. It provide us to refer and prepare for our next PHP projetcs.The currency lsist are as follows:

  1. CurrenCyconverterApi
  2. JsonRates
  3. dlvrit
  4. Fixer.io
  5. the references

Conclusion

In this article, we present the currency lists for us and show everyone who want to know the currency services.

If we complete the project, the article will be updated.

Make the PHP code clean and well

Introduction

In this artice, it’s just a list to present the rferences about making the PHP code better.

Table of contents

  1. article lists
  2. Conclusion

Article Lists

  1. clean-code-php
  2. PHP:The Right Way
  3. Decorator Design Pattern in PHP With Complete Source Code

Conclusion

In this article, we listed the useful reference links to let people know how to develop the PHP applications better.And the article lists will be updated from time to time.