Can’t install WordPress with LSCache on CyberPanel

It said it was successful, but the generic CyberPanel page still displayed when visiting the site.

Upon further investigation, the issue appeared to be with this command:

[email protected]:~# wp core download --allow-root --path=/home/example.com/public_html/
Downloading WordPress 5.5 (en_US)...
md5 hash verified: 983821e81b5b8398469e5c1807c4abf4
PHP Fatal error: Allowed memory size of 62914560 bytes exhausted (tried to allocate 36864 bytes) in phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Extractor.php on line 101

It looks like it ran out of memory during the installation.

Let’s review the memory limit and increase it if necessary.

SSH into your server and run wp --info to see which php.ini the WordPress CLI is using:

[email protected]:~# wp --info
OS:	Linux 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64
Shell:	/bin/bash
PHP binary:	/usr/bin/php7.4
PHP version:	7.1.33-3+bionic
php.ini used:	/usr/local/lsws/lsphp71/etc/php/7.1/litespeed/php.ini
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/root
WP-CLI packages dir:	
WP-CLI global config:	
WP-CLI project config:	
WP-CLI version:	2.3.0

In the case above, it’s the PHP 7.1 ini file.

Now login to CyberPanel and go to: PHP > Edit PHP Configs.

Select the PHP version that matches what you found above.

Take a look at your memory_limit configuration. If it says something like 60M, go ahead and increase it to 128M and click Save Changes.

After I tried to install WordPress again, everything worked as expected.

Leave a Reply

Your email address will not be published. Required fields are marked *