Problems Summary

  • Error 2003 while connecting the remote server
  1. Give the user privileges to login from %(or your IP), instead of just localhost
  2. Comment out bind-address( or bind your IP) and skip-networking in  /etc/mysql/mariadb.conf.d/50server.cnf
  • Python2 and python3 can exist at the same time
  1. Use python or python3 to execute the file
  2. apt-get install python3-pip to install pip for python3, and pip3 install to use it
  • Use crontab to set timed task
  1. crontab -e to edit the configure file
  2. can use .sh script if command is too long
  • Use tzselect to change timezone( MySQL’s timestamp is still UTC)

Guide of Installing WordPress

server: Debian 9 on Linode

  • Install Apache

Apache 2.2.22

At first, my server has a reverse proxy using nginx. So nginx is listening to port 80, while apache is listening to 127.0.0.1:8080. Nginx will pass .php requests to 8080. However, after logging in  this blog,  it will redirected to 127.0.0.1:8080. It seems to that wordpress reads my apache configure file. I can’t find other solution except for remove nginx. But remember to clear cache of this site, or the browser will keep redirecting it to 8080 because it had received a 301 Moved Permanently.

  • Install MySQL

Install and create new database as shown on wordpress.org

  • Install PHP7.2

Download and install php7.2 from website. There are two extensions needed – mysqli and zlib. Unfortunately,  I install neither of them while installing php. So I learnt to install it with phpize.

Because I use –prefix while installing, I can find phpize and php-config in /bin/ directory under php7 directory I specified.

In your installation directory, you can cd in specific extension’s directory, for exmample – /ext/mysqli/. Then, run phpize using absolute path.

absolute/path/to/phpize/phpize

If some library missed, install it. If config.m4 not found,

cp config0.m4 config.m4

After running phpize, you will get a configure file in current directory. Then

./configure –with-php-config=/usr/local/php7/bin/php-config –with-zlib=/usr

php-config’s path may change.