MySQL see all charsets

To see all charsets available on your MySQL installation, run the command

maxlen column specifies how many bytes are required to store one character.

latin1 charset uses 1 byte to store a character. uff8mb4 uses 4 bytes to store a character. See MySQL […]

Read More…

WordPress HyperDB

wordpress

HyperDB is a WordPress plugin that allows you to use multiple MySQL database servers with large MySQL installations. It is used to WordPress.com to distribute MySQL server load amount multiple MYSQL database servers hosted in different data centers. HyperDB supports Read and write servers (replication) Configurable priority for reading and writing Local and remote datacenters […]

Read More…

Warning: Use of undefined constant OAUTH_REQENGINE_CURL

Ubuntu PHP OAuth

On an Ubuntu server (Ubuntu 20.04.2 LTS) when running a PHP script, I get the following error.

On checking phpinfo, I get

curl is missing in “Request engine support”. This is because the default php-oauth package does not support curl. To fix, uninstall php-oauth and install oauth package using pecl. Uninstall pcel

[…]

Read More…

Enable SSL in Haproxy Docker Container

I have a haproxy container running on port 80. This container is started with command

This haproxy used following configuration file /home/ubuntu/haproxy/haproxy.cfg

To make this haproxy work with SSL, first create a ssl.pem file with your SSL certificate contents in following order

copy and paste all those certs into ssl.pem file inside […]

Read More…

PHP script to monitor exim mail queue

When you run exim mail server, it is good to keep an eye on number of emails in mail queue. here is a PHP script that will check number of emails in queue, if it exceed pre-set number, it will email you. Create file

Add following content.

In this case, if mails in […]

Read More…

Install SSL on Centova Cast

centovacast

Edit file

Find

Add below

Restart Centova Cast

At this point, you will be able to access Centova Cast on port 80 at

To install LetsEncrypt Free SSL certificate, run

Restart Centova Cast

Now you will be able to access Centova Cast using HTTPS. […]

Read More…

Change PHP version for a site in Plesk Command line

Plesk Change PHP version

To change PHP version for a site, first find available PHP handlers, this can be done with command

You need to find the id for the PHP handler. For PHP 5.6 fpm, it is “plesk-php56-fpm”. To change a sites PHP version to PHP 5.6, run

Example […]

Read More…

error: ‘x264_bit_depth’ undeclared (first use in this function)

When installing ffmpeg, i get error

This is due to incompatability with ffmpeg and x264. What you can do is try another version of x264. You will be able to download older version of x264 from ftp://ftp.videolan.org/pub/x264/snapshots On 2018-08-14, it failed with latest stable snapshot. So i tried 14 days old stable snapshot

[…]

Read More…

Enable Zend OPcache in PHP

Zend OPcache in phpinfo

To enable Zend OPCache in PHP, edit php.ini add following to end of the file

Now you may need to adjust some settings, in php.ini uncomment following, change values as needed.

Verify it with

Restart web server. If you using php-fpm or fcgi, you need to restart the process. phpinfo() will show […]

Read More…