A
A
Arthur2019-08-15 16:04:14
symfony
Arthur, 2019-08-15 16:04:14

How to install symfony on vagrant (homestead)?

Greetings.
I can’t install symphony from composer in any way, I get an error:

Could not delete /var/www/site.ru/www/vendor/symfony/flex/src/Command:

Logs:
[email protected]:/var/www/site.ru/www# composer -vvv create-project symfony/website-skeleton .
....
Package operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.4.5
  - Installing symfony/flex (v1.4.5): Reading /root/.cache/composer/files/symfony/flex/6d95ad17b465d814bf18c301dfe2e548420960f3.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/var/www/site.ru/www/vendor/symfony/flex/58b6844a5398a2e9d36347f1c9c4cf48' -d '/var/www/site.ru/www/vendor/composer/0819fb2d'
Loading plugin Symfony\Flex\Flex
Plugin installation failed, rolling back
  - Removing symfony/flex (v1.4.5)
Reading ./composer.json
Loading config file /root/.config/composer/config.json
Loading config file /root/.config/composer/auth.json
Loading config file ./composer.json
Reading /root/.config/composer/composer.json
Loading config file /root/.config/composer/config.json
Loading config file /root/.config/composer/auth.json
Loading config file /root/.config/composer/composer.json
Loading config file /root/.config/composer/auth.json
Reading /root/.config/composer/auth.json

                                                                             
  [RuntimeException]                                                         
  Could not delete /var/www/site.ru/www/vendor/symfony/flex/src/Command:  
                                                                             

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:217
 Composer\Util\Filesystem->unlink() at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:170
 Composer\Util\Filesystem->removeDirectoryPhp() at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:137
 Composer\Util\Filesystem->removeDirectory() at phar:///usr/local/bin/composer/src/Composer/Downloader/FileDownloader.php:238
 Composer\Downloader\FileDownloader->remove() at phar:///usr/local/bin/composer/src/Composer/Downloader/DownloadManager.php:299
 Composer\Downloader\DownloadManager->remove() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:224
 Composer\Installer\LibraryInstaller->removeCode() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:137
 Composer\Installer\LibraryInstaller->uninstall() at phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php:66
 Composer\Installer\PluginInstaller->install() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:173
 Composer\Installer\InstallationManager->install() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:160
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:597
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:229
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/CreateProjectCommand.php:195
 Composer\Command\CreateProjectCommand->installProject() at phar:///usr/local/bin/composer/src/Composer/Command/CreateProjectCommand.php:145
 Composer\Command\CreateProjectCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:61
 require() at /usr/local/bin/composer:24

Composer config config.json:
{
    "config": {
        "process-timeout":      2400,
        "preferred-install":    "dist",
        "github-protocols":     ["https"]
    }
}

Ubuntu 18.04.2 LTS
Php PHP 7.3.8 system (all symphony extensions installed - Ctype, iconv, JSON, PCRE, Session, SimpleXML, and Tokenizer)
Composer version 1.9.0 2019-08-02 20:55:32
Homestead 8.0 .1
VirtualBox 6.0.10
What could be wrong? There was a similar problem with Yii2, but adding time to the composer config helped with yui, it doesn’t help with symphony, and it’s not about time, because. The error pops up after 10-15 seconds. There are no problems with other packages.
When installing symfony as a command, the command itself works, checking the system requirements returns OK, but when I try to create a project, I also get a similar error "Could not delete /var/www/site.ru/www/site/vendor/symfony/flex/src /Command:".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arthur, 2019-08-15
@ar2rsoft

The problem turned out to be when installing to a directory that was mounted from the host machine. If you do the installation from the directory above, then everything is ok.
Those. the directory /var/www/site.ru/www is mounted, it is not installed in it.
to a directory that is not synchronized /var/www/site.ru/test was installed without errors.
The solution is to install in a different directory, then copy all the files to the working one.
Upd.
Will update the answer for future readers. It helps to change the type of synchronization:

folders:
    - map: C:/projects/site.ru/www/
      to: /var/www/site.ru/www/
      type: smb

D
Daria Motorina, 2019-08-15
@glaphire

It is strange that you install from the root, the composer loses the rights to delete the file due to the stacktrace, you definitely do not change anything in the process of deploying the project?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question