Monthly Archive: September 2020

String id cannot be empty in WordPress

How to know it: Open the wp-config.php file and change for this line:

define('WP_DEBUG', false);

to true

define('WP_DEBUG', true);

Problem: Same situation like this using WPML Plugin.

Solution: check database, there are some rows which id is zero. Try to delete all of them.

Then, the table must not have primary key, so set a primary key and set auto increment.

SET timeout value to prevent long-running SELECT queries for Mysql/MariaDB

Problem: Some WordPress plugin cause a lot of long-running queries and seems to want to run forever:( (You can check it out by entering SQL command “show processlist;”)

Solution: Set up session-wide or global timeout:

For MySQL, enter below command

SET SESSION MAX_EXECUTION_TIME=2000;
SET GLOBAL MAX_EXECUTION_TIME=2000;

For MariaDB, enter below command:

SET SESSION max_statement_time=2000;
SET GLOBAL max_statement_time=2000;

2000 is 2000 second.

Nextcloud in CentOS 7 guide

Suggested steps:

I suggest using Apache, because Nginx need more time to debug in some parts.

I suggest using BT panel (or AApanel for Eng ver -- https://www.aapanel.com/index.html)

Once you installed NextCloud, go to http://domain/index.php/settings/admin/overview to check any error that occurred.

  1. for error like “/.well-known/caldav” and “/.well-known/carddav” -> turn on apache rewrite function, restart apache and make sure you add AllowOverride All on Nextcloud directory on conf file.
  2. Suggest PHP 7.4. Install below php plugin: fileinfo, opcache, opcache, imagemagick, gmp. memory_limit set above 2GB. Then restart PHP
  3. for backup procedure, first you can take a reference in https://docs.nextcloud.com/server/15/admin_manual/maintenance/restore.html. Simply using command
rsync -Aax nextcloud-dirbkp/ nextcloud/

to backup folders. using command

sqlite3 data/owncloud.db .dump > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak

to backup SQlite.