1

I have a bash script that I'm using to install WordPress using wp-cli. Everything works fine except for setting the siteurl. The way I'm installing is:

wp core install --url=mysite --title=mysite --admin_user=admin --admin_password=password --admin_email=example@mysite.com

Even though it should be set at install, the siteurl still winds up being 'localhost', which then breaks everything since I'm using WAMP's virtual host. I tried manually updating with

wp option update siteurl mysite

but that just returns 'Success: Value passed for 'siteurl' option is unchanged.' and siteurl stays as localhost. The WP_SITEURL and WP_HOME values aren't even set in wp-config.php after the script runs. If I manually add them, everything works fine, but I really need it done through a script.

Mike
  • 517
  • 2
  • 5
  • 21
  • Just setup the vhost and then use the 5 minute install, from within the browser. https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install Using the vhost domain in the browser address bar – RiggsFolly Sep 24 '16 at 15:56
  • Also not sure how you are using a bash script on Windows. How are you doing that? – RiggsFolly Sep 24 '16 at 15:57
  • 1
    Yes, I'm fully aware of how to install WordPress. However, you did not answer what I asked at all; I specifically stated I need to do this through a bash script (using Git Bash). – Mike Sep 24 '16 at 18:30
  • Actually you made ZERO mention of the fact you were using Git++ – RiggsFolly Sep 24 '16 at 22:09
  • 1
    Regardless of what I was using, I asked a specific question and said I need this to be done with a script, and the answer you give me is to do install WordPress manually. It's a completely irrelevant answer. – Mike Sep 25 '16 at 04:00
  • Could you add an additional line in your script, prior to running the wp core install to execute wp core config and setup the expected variables? – bswatson Sep 26 '16 at 02:05

1 Answers1

0

I think I've just got it changed :

Try this :

# wp option set siteurl http://192.168.99.100 --allow-root
Success: Updated 'siteurl' option.
# wp option get siteurl --allow-root
http://192.168.99.100
# wp option set home http://192.168.99.100 --allow-root
Success: Updated 'home' option.
# wp option get home --allow-root
http://192.168.99.100