-
Notifications
You must be signed in to change notification settings - Fork 37
Description
The case:
Let's say I'm having a WordPress installation which is not working for some reason or WordPress installation leftovers in public_html/. Meanwhile I want to install and configure WordPress in public_html/some-random-subfolder using WP-CLI. I download and place the files in the subfolder, prepare DB and try to
wp config create
The action fails with:
wp config create --dbname=test --dbuser=test --dbpass=test --dbhost=127.0.0.1
Error: The 'wp-config.php' file already exists.
Here is what I have in the wp-config.php in the parent folder:
cat ../wp-config.php
<?php
echo "some broken or custom wp-config.php file";
require_once(__DIR__.'/wp-config-CUSTOM.php');
Additionally, all other WP-CLI commands except wp --info are also failing:
wp core
Error: Strange wp-config.php file: wp-settings.php is not loaded directly.
If there's no wp-config.php in the parent dir - it works:
ll ../wp-config*
ls: cannot access '../wp-config*': No such file or directory
wp config create --dbname=test --dbuser=test --dbpass=test --dbhost=127.0.0.1
ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)
(DB error above is normal, there's no such DB but the point is that I don't receive the wp-config.php related error)
If there is a valid WordPress application with a proper wp-config.php - it works as well.
So, the issue is if there is invalid wp-config/leftovers in the parent directory - this prevents me to configure a new, separate, independent WordPress app using WP-CLI in a sub-folder.
I've tested that on different 2 different stacks - LAMP and LEMP - the behaviour is the same.
Maybe it would be a good idea commands like "config", "core", etc. which could be related to installing and configuring separate application to be independent from the anything else than the files in the current folder?