Closed DriftwoodJP closed 7 years ago
If you have a problem at installing composer, please run vagrant provision
after a while.
I tried to vagrant up
and vagrant provision
5 times, but without success.
vagrant@vccw-xdebug:~$ composer
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
vagrant@vccw-xdebug:~$ echo $COMPOSER_HOME
/home/vagrant/.composer
vagrant@vccw-xdebug:~$ cat .composer/composer.json
{
"config": {
"secure-http": false
},
"require": {
"hirak/prestissimo": "*",
"phpunit/phpunit": "*",
"squizlabs/php_codesniffer": "*",
"wp-coding-standards/wpcs": "*"
}
}
vagrant@vccw-xdebug:~$ which phpunit
/home/vagrant/.composer/vendor/bin/phpunit
vagrant@vccw-xdebug:~$ which phpcs
vagrant@vccw-xdebug:~$ which wpcs
I decided to disable composer install from site.yml. Thanks :)
Could you try composer global require phpunit/phpunit
and please report the result.
OK. :)
site.yaml:
composers:
# - hirak/prestissimo:*
# - phpunit/phpunit:*
# - squizlabs/php_codesniffer:*
# - wp-coding-standards/wpcs:*
# - phpmd/phpmd:*
# - sebastian/phpcpd:*
# - phploc/phploc:*
# - phing/phing:*
Provisioning & SSH.
% vagrant up
% vagrant ssh
in Guest OS.
vagrant@vccw-xdebug:~$ composer global require phpunit/phpunit
Changed current directory to /home/vagrant/.composer
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Using version ^6.0 for phpunit/phpunit
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing sebastian/version (2.0.1)
Downloading: 100%
- Installing sebastian/resource-operations (1.0.0)
Downloading: 100%
- Installing sebastian/recursion-context (3.0.0)
Downloading: 100%
- Installing sebastian/object-reflector (1.1.0)
Downloading: 100%
- Installing sebastian/object-enumerator (3.0.2)
Downloading: 100%
- Installing sebastian/global-state (1.1.1)
Downloading: 100%
- Installing sebastian/exporter (3.0.0)
Downloading: 100%
- Installing sebastian/environment (2.0.0)
Downloading: 100%
- Installing sebastian/diff (1.4.1)
Downloading: 100%
- Installing sebastian/comparator (2.0.0)
Downloading: 100%
- Installing doctrine/instantiator (1.0.5)
Downloading: 100%
- Installing phpunit/php-text-template (1.2.1)
Downloading: 100%
- Installing phpunit/phpunit-mock-objects (4.0.1)
Downloading: 100%
- Installing phpunit/php-timer (1.0.9)
Downloading: 100%
- Installing phpunit/php-file-iterator (1.4.2)
Downloading: 100%
- Installing sebastian/code-unit-reverse-lookup (1.0.1)
Downloading: 100%
- Installing phpunit/php-token-stream (1.4.11)
Downloading: 100%
- Installing phpunit/php-code-coverage (5.0.3)
Downloading: 100%
- Installing webmozart/assert (1.2.0)
Downloading: 100%
- Installing phpdocumentor/reflection-common (1.0)
Downloading: 100%
- Installing phpdocumentor/type-resolver (0.2.1)
Downloading: 100%
- Installing phpdocumentor/reflection-docblock (3.1.1)
Downloading: 100%
- Installing phpspec/prophecy (v1.7.0)
Downloading: 100%
- Installing myclabs/deep-copy (1.6.0)
Downloading: 100%
- Installing phpunit/phpunit (6.0.10)
Downloading: 100%
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
Writing lock file
Generating autoload files
vagrant@vccw-xdebug:~$ phpunit --version
PHPUnit 6.0.10 by Sebastian Bergmann and contributors.
vagrant@vccw-xdebug:~$ which phpunit
/home/vagrant/.composer/vendor/bin/phpunit
The problem is now solved. We need to repalce the current composer version to 1.3.1 or later for Xdebug.
provision/playbooks/commands.yml
- hosts: all
vars:
wp_cli_bin_url: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar
composer_version: 1.3.1
and more memory to the virtual machine.
TASK [Install Composer libraries] **********************************************
changed: [vccw-xdebug.dev] => (item=hirak/prestissimo:*)
failed: [vccw-xdebug.dev] (item=phpunit/phpunit:*) => {"failed": true, "item": "phpunit/phpunit:*", "msg": "./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 25 installs, 0 updates, 0 removals - Installing sebastian/version (2.0.1) Loading from cache Installation failed, reverting ./composer.json to its original content. The following exception is caused by a lack of memory or swap, or not having swap configured Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details PHP Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 973 [ErrorException] proc_open(): fork failed - Cannot allocate memory require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...", "stdout": "./composer.json has been updated\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nPackage operations: 25 installs, 0 updates, 0 removals\n - Installing sebastian/version (2.0.1) Loading from cache\nInstallation failed, reverting ./composer.json to its original content.\nThe following exception is caused by a lack of memory or swap, or not having swap configured\nCheck https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details\n\nPHP Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 973\n \n [ErrorException] \n proc_open(): fork failed - Cannot allocate memory \n \n\nrequire [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...\n\n", "stdout_lines": ["./composer.json has been updated", "Loading composer repositories with package information", "Updating dependencies (including require-dev)", "Package operations: 25 installs, 0 updates, 0 removals", " - Installing sebastian/version (2.0.1) Loading from cache", "Installation failed, reverting ./composer.json to its original content.", "The following exception is caused by a lack of memory or swap, or not having swap configured", "Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details", "", "PHP Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 973", " ", " [ErrorException] ", " proc_open(): fork failed - Cannot allocate memory ", " ", "", "require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...", ""]}
changed: [vccw-xdebug.dev] => (item=squizlabs/php_codesniffer:*)
...ignoring
changed: [vccw-xdebug.dev] => (item=wp-coding-standards/wpcs:*)
like this.
#
# Virtual Machine Settings
#
memory: 1024
cpus: 1
I hope to modify default settings in the next version. Thanks :)
Operating System: 10.12.3 Vagrant Version: 1.9.2 Virtual Box Version: 5.1.16-113841
I created the new project with vccw-team/scaffold-vccw.
Sources:
Faild error:
Into Guest OS
vagrant ssh
.I don't Know Ansible but it looks like provisioning error happened.