2 Clarified problem in the title
| link

Installing Wordpress via WP-CLI: not working with a bashfrom Bash script?

    Bumped by Community user
    Bumped by Community user
1
source | link

Installing Wordpress via WP-CLI: not working with a bash script?

I am trying to make installations easier on my Mac using MAMP by using WP-CLI.

I made a simple .sh file:

wp core download
wp core config --dbname=dbname --dbuser=root --dbpass=root
wp db create
wp core install --url="http://localhost:8888/folder" --title="name" --admin_user="admin" --admin_password="password" --admin_email="my@email.com"

This works fine when I enter it line by line in the terminal, however as soon as I turn it into a .sh file and run it through sh install.sh, it stops as soon as the database is created, but doesn't actually install Wordpress into the database.

What could cause this? This is the wp --info output:

PHP binary: /Applications/MAMP/bin/php/php7.1.0/bin/php
PHP version:    7.1.0
php.ini used:   /Applications/MAMP/bin/php/php7.1.0/conf/php.ini
WP-CLI root dir:    phar://wp-cli.phar
WP-CLI packages dir:    
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 1.0.0