Support

Akeeba Backup for WordPress

#41752 siteurl not read from config.yml.php

Posted in ‘Akeeba Backup for WordPress’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

WordPress version
6.7.2
PHP version
8.3.*
Akeeba Backup version
9.0.2

Latest post by jduerscheid on Thursday, 27 March 2025 04:58 CDT

jduerscheid

After applying a temporary fix for the issue mentioned in my other ticket, I'm now running into a new issue: The restore script fails to read the siteurl variable from the config file:

php installation/cli.php execute
Akeeba Backup Restoration Script v.10.0.2
Copyright (C) 2006-2025 Akeeba Ltd.
This program is Free Software, it comes with ABSOLUTELY NO WARRANTY and you are
welcome to redistribute it under certain conditions; use the `license` command
for more information.

Initialising restoration
» Detecting versions
» Loading existing configuration
» No wp-config.php found
Restoring database ‘site’
» Restored 1.26 MB of 1.26 MB (0.00%) – ETA: 0 seconds
» Finished

ERROR

Unhandled Akeeba\BRS\Framework\Cli\Exception\ExecutionException exception

You need to set the siteurl or homeurl in your config.yml.php file.

-- /redacted/installation/platform/src/Cli/Step/Setup.php:87
#0 /redacted/installation/platform/src/Cli/Step/Setup.php(35): Akeeba\BRS\Platform\Cli\Step\Setup->setURLsInHelper()
#1 /redacted/installation/src/Framework/Cli/InstallationQueue.php(177): Akeeba\BRS\Platform\Cli\Step\Setup->execute()
#2 /redacted/installation/src/Cli/Command/Execute.php(56): Akeeba\BRS\Framework\Cli\InstallationQueue->execute()
#3 [internal function]: Akeeba\BRS\Cli\Command\Execute->__invoke()
#4 /redacted/installation/src/Cli/Application/Application.php(111): call_user_func()
#5 /redacted/installation/cli.php(107): Akeeba\BRS\Cli\Application\Application->execute()
#6 {main}

The respective config section, generated by config:make, is:

setup:
superuserid: 0
superuseremail: null
superuserpassword: null
superuserpasswordrepeat: null
blogname: RemoteWP
blogdescription: ''
homeurl: ''
siteurl: ''
dbcharset: utf8mb4
dbcollation: ''
removephpini: false
removehtpasswd: false
htaccessHandling: none
disable_autoprepend: false

nicholas
Akeeba Staff
Manager

If I understand you correctly, you have not modified the config.yml.php file, or at least not provided a siteurl in there. If this is the case, the error message you are receiving is correct, and it's exactly is supposed to happen. Since we are under CLI we cannot know what the site's URL is. You have to provide it in the siteurl parameter.

Watch out! You have to provide the siteurl parameter which corresponds to the WP_SITEURL constant in WordPress and which used to be labelled Site URL in WordPress (and our restoration script), but is now labelled WordPress Address URL. The most confusing part is that our homeurl parameter which corresponds to WP_HOME in WordPress and which used to be labelled Home URL is now labelled by WordPress as Site Address (URL), confusing the living daylights out of everyone who –unlike WordPress core maintainers– is not a sadistic psychopath.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jduerscheid

Whoops sorry! I anonymized both snippets and removed the value from "siteurl" where it should have been "redacted" - in other words: the config does contain a value, format is

siteurl: 'https://[redaced].org/wordpress'

However I debugged a little further. It seems like the issue is related to how config:make generates the default "replacements" section as in my example it has the following value:

'https://[redaced].org/wordpress': ''

So, the script is indeed using the provided siteurl from the config, however it will then set it to an empty value in the replacement step. WP will show an DB connection error when the siteurl option is empty, so I was assuming that the restoration failed and repeated the script. When I then re-ran the script, it's apparently consumed not only the config.yml.php value (which is fine) but also the existing siteurl (not sure why) from the DB - and is throwing an error as described in the first post.

So, long story short: the replacement value generated by config:make was wrong.

Case close from my side.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!