SOLVED WordPress Toolkit error Could not create new 'wp-config.php' file.

tpartzard

Member
Oct 15, 2021
8
0
1
Thailand
cPanel Access Level
Root Administrator
I can't install wordpress via wordpress toolkit

Here are some errors I found in the wordpress toolkit logs.

[2022-08-01 06:08:26.504] DEBUG Rollback WordPress installation of instance #1913: remove from WPT database
[2022-08-01 06:08:26.518] DEBUG Execute shell command: 'rm -rf /usr/local/cpanel/3rdparty/wp-toolkit/var/logs/action-logs/0989f26c-276f-4e54-b60f-0ba3f67d6de7'
[2022-08-01 06:08:26.527] DEBUG Exit code: '0'
Command output: ''
[2022-08-01 06:08:26.536] ERROR Error: Could not create new 'wp-config.php' file.[2022-08-01 06:08:26.536] DEBUG PleskExt\WpToolkit\Exception\WpCliExecutionException: Error: Could not create new 'wp-config.php' file.
in /usr/local/cpanel/3rdparty/wp-toolkit/plib/library/Capability/WpCli/WpCliUtils.php:42
Stack trace:
#0 /usr/local/cpanel/3rdparty/wp-toolkit/plib/library/Capability/WpCli/LocalCpanel.php(145): PleskExt\WpToolkit\Capability\WpCli\WpCliUtils::throwWpCliExecError('Error: Could no...', 'Unix', '')
#1 /usr/local/cpanel/3rdparty/wp-toolkit/plib/library/Capability/WpCli/WpCli.php(140): PleskExt\WpToolkit\Capability\WpCli\LocalCpanel->call(Array, '{"WORDPRESS_PRO...', Array, false, NULL)
 

Attachments

Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,248
2,423
363
cPanel Access Level
Root Administrator
Hey there! Is it possible there is already a WordPress site or a wp-config.php file on the account? Although no sites are linked to WordPress Toolkit yet according to your screenshot, a manual installation that hasn't been linked is still possible, and that would cause this error.

As a test, you could try installing WordPress in a different directory to see if that works well. If that does work, the problem is with something specific to the original installation directory.
 

tpartzard

Member
Oct 15, 2021
8
0
1
Thailand
cPanel Access Level
Root Administrator
Hey there! Is it possible there is already a WordPress site or a wp-config.php file on the account? Although no sites are linked to WordPress Toolkit yet according to your screenshot, a manual installation that hasn't been linked is still possible, and that would cause this error.

As a test, you could try installing WordPress in a different directory to see if that works well. If that does work, the problem is with something specific to the original installation directory.
I have installed it in a new directory and tested it on a new account, but still the same issue.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,248
2,423
363
cPanel Access Level
Root Administrator
I did reach out to the WordPress Toolkit team, and they were also not familiar with this error. Our support team would be able to provide you with a list of IP addresses for server access, so you wouldn't have to open up SSH or WHM globally, if that would ease some concerns about submitting a ticket, but it seems we may be in uncharted territory here.
 

tpartzard

Member
Oct 15, 2021
8
0
1
Thailand
cPanel Access Level
Root Administrator
I did reach out to the WordPress Toolkit team, and they were also not familiar with this error. Our support team would be able to provide you with a list of IP addresses for server access, so you wouldn't have to open up SSH or WHM globally, if that would ease some concerns about submitting a ticket, but it seems we may be in uncharted territory here.
I've already opened a ticket to your support team. The issue caused by imunify360 generated a rule preventing /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/config-command/src/Config_Command.php

Thank you very much for support.
 

HostXNow_Chris

Well-Known Member
PartnerNOC
Jan 22, 2016
91
47
68
United Kingdom
cPanel Access Level
DataCenter Provider
Twitter
I started noticing this issue.

cPanel promotes Imunify360. Why on earth would Imunify360 start blocking a process from cPanel WordPress Toolkit!? It can make the web host look at fault.

So the solution is to

Ignore detected rules for those files

Path: /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/config-command/src/Config_Command.php
Rules: Auto Immunity rule generated on 2023-02-28 18:14:16.303399

Here's an idea, as cPanel/Imunify360 are partners, why don't cPanel ask Imunuify360 to whitelist the above automatically? :-p