Home >CMS Tutorial >WordPress >How to use a proxy server to solve the problem of slow WordPress upgrade

How to use a proxy server to solve the problem of slow WordPress upgrade

藏色散人
藏色散人forward
2020-03-09 16:47:474641browse

The following column WordPress Tutorial will introduce to you how to use a proxy server to solve the problem of slow WordPress upgrade. I hope it will be helpful to friends in need!

How to use a proxy server to solve the problem of slow WordPress upgrade

There are two ways to update the WordPress version, click automatic upgrade in the background or manually download the new version to replace the old one. For convenience, the former is generally chosen to automatically upgrade. However, since the automatic upgrade uses the foreign server downloads.wordpress.org, automatically upgrading WordPress in China will be very slow or even time out and fail.

However, wordpress provides a method to set up a proxy. I have set up a proxy server on a foreign server, which can be used directly. Due to the restriction of the proxy server, it can only proxy the wordpress.org domain name. Please ask after use. Comment out the code so as not to affect WordPress usage.

Solution

Open wp-config.php and add the following code at the bottom:

define('WP_PROXY_HOST', 'us.centos.bz');
define('WP_PROXY_PORT', '31281');

After saving, log in to the WordPress backend and switch to update. Click the Upgrade button to start the update.

After the update is completed, please comment out the code you just added, that is, add // in front, such as:

//define('WP_PROXY_HOST', 'us.centos.bz');
//define('WP_PROXY_PORT', '31281');

Delete the comment next time you need to upgrade.

How to use a proxy server to solve the problem of slow WordPress upgrade

The above is the detailed content of How to use a proxy server to solve the problem of slow WordPress upgrade. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete