WordPress
Setup the memory limit used by WordPress in wp-config.php
. The figures should not exceed the memory_limit
of php
define('WP_MEMORY_LIMIT', '128M');
define('WP_MAX_MEMORY_LIMIT', '256M');
Secure the cookie in wp-config.php
:
@ini_set('session.cookie_httponly', true);
@ini_set('session.cookie_secure', true);
@ini_set('session.use_only_cookies', true);
PHP
Edit php.ini
upload_max_filesize = 20M
post_max_size = 20M
memory_limit = 256M
session.cookie_secure = 1
session.cookie_httponly = 1
The path of php.ini
:
- Usually:
/etc/php.ini
- LiteSpeed:
/usr/local/lsws/lsphp82/etc/php.ini
Note:
- If using php-fpm, the configurations in
/etc/php-fpm.d/www.conf
overwritesphp.ini
- If using LiteSpeed, need
killall lsphp
to make the settings effective.
Pingback: How to install OpenLiteSpeed for WordPress – 美丽传说365
Pingback: How to migrate WordPress on CentOS8 – 美丽传说365