How to change WordPress site URL and home URL using wp-cli tool

To check site url:

wp option get siteurl

To update your website’s URL:

wp option update home 'https://alltime.pp.ua'
wp option update siteurl 'https://alltime.pp.ua'

This will update to MySQL records “home” and “siteurl

To run in-deep updates read the following article:

https://alltime.pp.ua/blog/how-to-change-wordpress-main-url-to-new-one/Read the rest

How to install/reinstall mailman on cPanel server

Check Tweak Settings, should be ‘0’

cat /var/cpanel/cpanel.config |grep skipmailman

skipmailman=0

Deprecated scripts

/scripts/reinstallmailman
/usr/local/cpanel/bin/mailman-install --force

Deprecated scripts:

/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.mailman installed
/usr/local/cpanel/scripts/check_cpanel_rpms --fix --targets=mailman

The latest way to reinstall mailman on cPanel server:

rpm -e --nodeps cpanel-mailman
/usr/local/cpanel/scripts/check_cpanel_rpms --fix --targets=mailman

Run upcp:

/scripts/upcp --force
systemctl start mailman.service
Read the rest

How to create a post using wp-cli

Install wp-cli and run something like the following:

wp post create --post_type=page --post_status=publish --post_title='Home' 
wp post create --post_type=page --post_status=publish --post_title='About'
wp post create --post_type=page --post_status=publish --post_title='News'
wp post create --post_type=page --post_status=publish --post_title='Contact'
Read the rest

How to fix “Sorry, you are not allowed to access this page.”

Using WP-CLI

If you see an empty ROLES then it is

wp user list
+----+------------+--------------+--------------------------------+---------------------+---------------+
| ID | user_login | display_name | user_email            | user_registered                | roles |
+----+------------+--------------+--------------------------------+---------------------+---------------+
| 1  | admin1     | admin1           | [email protected] | 2018-06-19 17:00:02 |         |
+----+------------+--------------+--------------------------------+---------------------+---------------+

So add admin right for this user:

wp user set-role 1 administrator

Check it, should be good now:

wp user list
+----+------------+--------------+--------------------------------+---------------------+---------------+
| ID | user_login | display_name | user_email            | user_registered                | roles |
+----+------------+--------------+--------------------------------+---------------------+---------------+
| 1  | admin1     | admin1           | [email protected]
Read the rest

How to work around “is not an EA4 SCL PHP” error

“ea-php72” is not an EA4 SCL PHP

Update both .bash_profile and .bashrc files under your home/ directory as following:

export PATH=/opt/alt/php72/usr/bin:$PATH
alias ea-php72="/usr/local/bin/lsphp"

Use a real path to your PHP binary file if its not yours /usr/local/bin/lsphp

Run to apply updates:

source .bashrc
Read the rest

SMTP Error: Message size exceeds server limit

You seems got this error at Roundcube or Horde.

Here is explanation how it works:

Supposedly you’re trying to send message with an attachment file 44M

And you have the message_size_limit set in 50M as explained here

And you will not be able to send such message because attachments in a message are encoded by base64

It means your message will be by 30% bigger than expected, please see below calculation

44*0.30=57

You cannot send such message due to the limit in 50M, so you need either rise message_size_limit or upload and share your attachment to services like Gdrive/Dropbox/etc… Read the rest