Top Nav

Archive | Web

WordPress External Cron

For low traffic WordPress sites, the internal cron will not run on a reliable schedule resulting in missed jobs. For high traffic sites the internal cron can result in excessive cron runs. The solution is to disable the internal cron and setup an external cronjob at the operating system level.

To disable the internal cron add the following to wp-config.php:

For the external cron you can use curl or wget, but my preference is wp-cli like this:

On a Plesk server this might look like:

0

Regenerate WP-Rocket .htaccess From Command Line

To regenerate the .htaccess file with WP-Rocket rules from the command line do the following:

  • Install wp-rocket extension for wp-cli:

  • Regenerate the .htaccess file:

There are additional useful commands on the rocket extension. See https://github.com/GeekPress/wp-rocket-cli for details.

 

 

 

0

Magento 2 – Add Admin From Command Line

To add an admin user to a Magento 2 site from the command line, SSH to the server and change to the root directory of the Magento 2 install. Then run this command:

On a server with Plesk a few notes:

  • It’s best to run this command as the user that owns the website subscription.
  • You may need to set the path to the correct PHP version with “export PATH=/opt/plesk/php/7.0/bin/php:$PATH”.
  • If you get “PHP Fatal error: Allowed memory size of xxxxxxx bytes exhausted” then edit the php.ini file for the correct PHP version and increase the “memory_limit” setting.

 

0

Drupal Admin Password Reset With Drush

SSH into the website document root and install drush:

Use drush to reset admin user password:

 

0

Quick WordPress Install With wp-cli

These steps assume that wp-cli is installed and a database has been created.

 

0