PHP Upgrades At Reliable Penguin
Learn why PHP upgrades matter, how they affect your website’s security and performance, and what Reliable Penguin customers (and any PHP-powered site owner) should know to stay current and protected.
Learn why PHP upgrades matter, how they affect your website’s security and performance, and what Reliable Penguin customers (and any PHP-powered site owner) should know to stay current and protected.
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:
To regenerate the .htaccess file with WP-Rocket rules from the command line do the following: Install wp-rocket extension for wp-cli:
|
1 |
wp package install geekpress/wp-rocket-cli |
Regenerate the .htaccess file:
|
1 |
wp rocket regenerate --file=htaccess |
There are additional useful commands on the rocket extension. See https://github.com/GeekPress/wp-rocket-cli for details.
These steps assume that wp-cli is installed and a database has been created.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cd /var/www/vhosts/example.com/httpdocs wp core download wp core config --dbname=wordpress \ --dbuser=user \ --dbpass=password \ --dbhost=localhost wp core install --url="http://example.com" \ --title="Blog Title" --admin_user="adminuser" \ --admin_password="password" \ --admin_email="email@example.com" |
Here’s a prompted version:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
read -p "Enter domain: " WPDOMAIN && \ read -p "Enter user: " WPUSER && \ read -p "Enter pass: " WPPASS && \ read -p "Enter email: " WPEMAIL && \ read -p "Enter DB host: " DBHOST && \ read -p "Enter DB name: " DBNAME && \ read -p "Enter DB user: " DBUSER && \ read -p "Enter DB pass: " DBPASS && \ echo "$DBHOST $DBNAME $DBUSER $DBPASS $WPDOMAIN $WPUSER $WPPASS $WPEMAIL" && \ wp core download && \ wp core config --dbname=$DBNAME \ --dbuser=$DBUSER \ --dbpass=$DBPASS \ --dbhost=$DBHOST && \ wp core install --url="$WPDOMAIN" \ --title="$WPDOMAIN" \ --admin_user="$WPUSER" \ --admin_password="$WPPASS" \ --admin_email="$WPEMAIL" |
Add this code to wp-config.php to stop redirect loops caused by SSL termination on a proxy or load balancer:
|
1 2 3 |
/** SSL termination fix **/ if (array_key_exists('HTTP_X_FORWARDED_PROTO',$_SERVER) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; |
Reliable Penguin provides managed web hosting, systems administration, website and server migrations, and expert consulting.
Submit the form—or for immediate service call 866-649-7984.