If by any chance we encountered this problem
We will copy the following code to the following file:
~/etc/my.cnf
max_allowed_packet = 8024M
wait_timeout=1180 innodb_buffer_pool_size = 256M innodb_additional_mem_pool_size = 10M
innodb_lock_wait_timeout = 180
save the file
and restart the MariaDB using the following command.
systemctl restart mariadb
and that is all
source:
https://stackoverflow.com/questions/33097854/pdoexception-general-error-2006-mysql-server-has-gone-away