Can't install Wordpress

Hi,

I’ve just updated to EasyEngine 3.2.0 and, coincidentally or not, next I’ve tried to create a new Wordpress site, but without success… I’ve tried --wp or --wpfc, with or without HHVM or Pagespeed. The result is always the following:

Running pre-update checks, please wait… Setting up NGINX configuration [Done] Setting up webroot [Done] Downloading Wordpress [Done] Setting up database [Done] Unable to move file from /var/www/xxxxx/htdocs/wp-config.php to /var/www/xxxxx

It creates the site, folders, etc. But fails to install Wordpress itself (that’s way it can’t move wp-config.php - because it doesn’t exist).

Regards

@Joao_Amado

could you please provide the logs for the problem faced.?

tail -n100 /var/log/ee/ee.log

Here it goes, with domains/users masked:]

2015-05-28 11:20:56,863 (DEBUG) ee : loading template file /usr/lib/ee/templates/virtualconf.mustache
2015-05-28 11:20:56,944 (DEBUG) ee : Checking generated nginx conf, please wait...
2015-05-28 11:20:57,103 (INFO) ee : [Done]
2015-05-28 11:20:57,104 (DEBUG) ee : Creating Symbolic link, Source:/etc/nginx/sites-available/example.com, Dest:/etc/nginx/sites-enabled/example.com
2015-05-28 11:20:57,104 (INFO) ee : Setting up webroot 		
2015-05-28 11:20:57,105 (DEBUG) ee : Creating Symbolic link, Source:/var/log/nginx/example.com.access.log, Dest:/var/www/example.com/logs/access.log
2015-05-28 11:20:57,105 (DEBUG) ee : Creating Symbolic link, Source:/var/log/nginx/example.com.error.log, Dest:/var/www/example.com/logs/error.log
2015-05-28 11:20:57,105 (INFO) ee : [Done]
2015-05-28 11:20:57,285 (INFO) ee : Downloading Wordpress 		
2015-05-28 11:20:57,286 (DEBUG) ee : Changing directory to /var/www/example.com/htdocs/
2015-05-28 11:20:57,286 (DEBUG) ee : Running command: wp --allow-root core download
2015-05-28 11:21:02,965 (DEBUG) ee : Command Output: Downloading WordPress 4.2.2 (en_US)...
[Thu May 28 11:21:02 2015] [hphp] [9195:7ff92fff3dc0:0:000001] [] 
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/tmp/wp_5567325b1199a/): failed to open dir' in :
Stack trace:
#0 (): DirectoryIterator->__construct()
#1 (): FilesystemIterator->__construct()
#2 phar://wp-cli.phar/php/commands/core.php(197): RecursiveDirectoryIterator->__construct()
#3 phar://wp-cli.phar/php/commands/core.php(190): Core_Command::_copy_overwrite_files()
#4 phar://wp-cli.phar/php/commands/core.php(167): Core_Command::_extract()
#5 (): Core_Command->download()
#6 phar://wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php(52): call_user_func()
#7 (): {closure}()
#8 phar://wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php(293): call_user_func()
#9 phar://wp-cli.phar/php/WP_CLI/Runner.php(304): WP_CLI\Dispatcher\Subcommand->invoke()
#10 phar://wp-cli.phar/php/WP_CLI/Runner.php(311): WP_CLI\Runner->run_command()
#11 phar://wp-cli.phar/php/WP_CLI/Runner.php(52): WP_CLI\Runner->_run_command()
#12 phar://wp-cli.phar/php/WP_CLI/Runner.php(599): WP_CLI\Runner->do_early_invoke()
#13 phar://wp-cli.phar/php/wp-cli.php(20): WP_CLI\Runner->before_wp_load()
#14 phar://wp-cli.phar/php/boot-phar.php(5): include()
#15 /usr/bin/wp(4): include()
#16 {main}
, 
Command Error: 
2015-05-28 11:21:02,966 (INFO) ee : [Done]
2015-05-28 11:21:02,967 (DEBUG) ee : Autofix MySQL username (ERROR 1470 (HY000)), please wait
2015-05-28 11:21:02,968 (INFO) ee : Setting up database		
2015-05-28 11:21:02,968 (DEBUG) ee : Creating database example_com
2015-05-28 11:21:02,972 (DEBUG) ee : Database already exists, Updating DB_NAME .. 
2015-05-28 11:21:02,975 (DEBUG) ee : Exceuting MySQL Statement : create database `example_bhiNJ0LWqj4`
2015-05-28 11:21:02,976 (DEBUG) ee : Creating user example_bHWIbx3XdeP
2015-05-28 11:21:02,976 (DEBUG) ee : create user `example_bHWIbx3XdeP`@`localhost` identified by ''
2015-05-28 11:21:02,979 (DEBUG) ee : Setting up user privileges
2015-05-28 11:21:02,981 (DEBUG) ee : Exceuting MySQL Statement : grant all privileges on `example_bhiNJ0LWqj4`.* to `example_bHWIbx3XdeP`@`localhost`
2015-05-28 11:21:02,983 (INFO) ee : [Done]
2015-05-28 11:21:02,983 (DEBUG) ee : Changing directory to /var/www/example.com/htdocs/
2015-05-28 11:21:02,983 (DEBUG) ee : Setting up wp-config file
2015-05-28 11:21:02,984 (DEBUG) ee : Generating wp-config for WordPress Single site
2015-05-28 11:21:02,984 (DEBUG) ee : bash -c "php /usr/bin/wp --allow-root core config --dbname='example_bhiNJ0LWqj4' --dbprefix='wp_' --dbuser='example_bHWIbx3XdeP' --dbhost='localhost' --dbpass= --extra-php<<PHP 
 

define('WP_DEBUG', false);
PHP"
2015-05-28 11:21:03,921 (DEBUG) ee : Command Output: , 
Command Error: Error: This does not seem to be a WordPress install.
Pass --path=`path/to/wordpress` or run `wp core download`.

2015-05-28 11:21:03,921 (DEBUG) ee : Moving file from /var/www/example.com/htdocs/wp-config.php to /var/www/example.com
2015-05-28 11:21:03,922 (DEBUG) ee : [Errno 2] No such file or directory: '/var/www/example.com/htdocs/wp-config.php'
2015-05-28 11:21:03,922 (ERROR) ee : Unable to move file from /var/www/example.com/htdocs/wp-config.php to /var/www/example.com
2015-05-28 11:22:01,703 (DEBUG) ee : logging initialized for 'ee' using LoggingLogHandler
2015-05-28 11:22:02,010 (DEBUG) ee : ['/usr/local/sbin/ee', 'site', 'delete', 'example.com']
2015-05-28 11:22:02,010 (DEBUG) ee : collecting arguments/commands for <ee.cli.controllers.base.EEBaseController object at 0x7f1639949c50>
2015-05-28 11:22:02,015 (DEBUG) ee : collecting arguments/commands for <ee.cli.plugins.site.EESiteController object at 0x7f1639957390>
2015-05-28 11:22:02,017 (DEBUG) ee : collecting arguments/commands for <ee.cli.plugins.site.EESiteDeleteController object at 0x7f16399576d8>
2015-05-28 11:22:02,021 (INFO) ee : Initializing EasyEngine Database
2015-05-28 11:22:02,866 (INFO) ee : Deleting Database, None, user None
2015-05-28 11:22:02,869 (DEBUG) ee : dropping database `None`
2015-05-28 11:22:02,870 (DEBUG) ee : Exceuting MySQL Statement : drop database `None`
2015-05-28 11:22:02,871 (DEBUG) ee : (1008, "#HY000Can't drop database 'None'; database doesn't exist")
2015-05-28 11:22:02,871 (DEBUG) ee : drop database failed
2015-05-28 11:22:02,871 (INFO) ee : Database None not dropped
2015-05-28 11:22:02,872 (DEBUG) ee : dropping user `None`
2015-05-28 11:22:02,873 (DEBUG) ee : Exceuting MySQL Statement : drop user `None`@`localhost`
2015-05-28 11:22:02,874 (DEBUG) ee : (1396, "#HY000Operation DROP USER failed for 'None'@'localhost'")
2015-05-28 11:22:02,875 (DEBUG) ee : drop database user failed
2015-05-28 11:22:02,875 (INFO) ee : Database None not dropped
2015-05-28 11:22:02,877 (DEBUG) ee : Exceuting MySQL Statement : flush privileges
2015-05-28 11:22:02,884 (INFO) ee : Deleted Database successfully.
2015-05-28 11:22:03,546 (INFO) ee : Deleting Webroot, /var/www/example.com
2015-05-28 11:22:03,547 (DEBUG) ee : Removing /var/www/example.com
2015-05-28 11:22:03,547 (DEBUG) ee : Removing /var/www/example.com
2015-05-28 11:22:03,555 (INFO) ee : Deleted webroot successfully
2015-05-28 11:22:03,556 (DEBUG) ee : Removing Nginx configuration
2015-05-28 11:22:03,556 (DEBUG) ee : Removing /etc/nginx/sites-enabled/example.com
2015-05-28 11:22:03,556 (DEBUG) ee : Removing /etc/nginx/sites-available/example.com
2015-05-28 11:22:03,556 (INFO) ee : Reload : nginx     
2015-05-28 11:22:03,974 (INFO) ee : [OK]
2015-05-28 11:22:04,019 (INFO) ee : Deleted site example.com
2015-05-28 11:22:48,339 (DEBUG) ee : logging initialized for 'ee' using LoggingLogHandler
2015-05-28 11:22:48,693 (DEBUG) ee : ['/usr/local/sbin/ee', 'update']
2015-05-28 11:22:48,693 (DEBUG) ee : collecting arguments/commands for <ee.cli.controllers.base.EEBaseController object at 0x7f0fe3ecac18>
2015-05-28 11:22:48,698 (DEBUG) ee : collecting arguments/commands for <ee.cli.plugins.update.EEUpdateController object at 0x7f0fe3ed9160>
2015-05-28 11:22:48,701 (INFO) ee : Initializing EasyEngine Database
2015-05-28 11:22:48,705 (INFO) ee : Downloading update script       
2015-05-28 11:22:49,547 (INFO) ee : [Done]
2015-05-28 11:22:49,547 (INFO) ee : updating EasyEngine, please wait...
2015-05-28 11:22:59,940 (DEBUG) ee : logging initialized for 'ee' using LoggingLogHandler
2015-05-28 11:23:00,379 (DEBUG) ee : ['/usr/local/sbin/ee', '-v']
2015-05-28 11:23:00,379 (DEBUG) ee : collecting arguments/commands for <ee.cli.controllers.base.EEBaseController object at 0x7fe15f3d6c18>

Any idea on this?!..

Nobody knows what could be causing this situation, on which wordpress ins’t installed because “failed to open dir’” ? Regards

It seems the ee script tries to access a directory that’s not available (i.e. “DirectoryIterator::__construct(/tmp/wp_558190b90d87a/)”) because “wordpress” was uncompressed to an “wordpress” directory and not an “wp_558190b90d87a”… Is this an script problem or anything else? Is wordpress uncompressing correctly or not?

Any help on this? It seems to be that the wordpress install script is expecting an uncompressed folder different than the actual one…

@Joao_Amado

EasyEngine uses wpcli to setup wordpress sites, looks like wpcli is unable to create directory under /tmp

refer https://github.com/wp-cli/wp-cli/issues/1135

I’m the only one not being able to install wordpress sites with easyengine?!..

No, it doesn’t appear that you are the only one.

Your issue seems to be very similar to this one: Unable to add new site anymore using EasyEngine

Tkx for the feedback about the other thread… I really can’t be sure this is ee script problem or wp-cli one… but the fact is that this situation is very recent.

I just faced the very same issue on a fresh install.

What I did to solve my problem was:

ee stack remove --wpcli; ee stack install wpcli

1 Like

Yes @janiosarmento, I too can confirm that removing/re-installing --wpcli has fixed this issue on a couple of my problematic EE installations. Great call!

This should read: ee stack remove --wpcli; ee stack install --wpcli

I can also confirm that it was the required solution.