我有一个新安装的Symfony,除了我的供应商目录是空的之外,其他所有东西都在看?也就是说,它已经作曲家和学说目录,但它们是空的。如果我站在我的根并运行命令:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Downloading: 100%
Failed to download doctrine/lexer from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing doctrine/lexer (v1.0.1)
Cloning 83893c552fd2045dd78aef794c31e694c37c0b8c
[RuntimeException]
Failed to clone git@github.com:doctrine/lexer.git via git, https, ssh protocols, aborting.
- git://github.com/doctrine/lexer.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer'...
fatal: remote composer already exists.
- https://github.com/doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
- git@github.com:doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
在前端浏览到http://symfony.local/web/
Warning: require(C:Apache24htdocssymfony.localapp/../vendor/autoload.php): failed to open stream: No such file or directory in C:Apache24htdocssymfony.localappautoload.php on line 11
Fatal error: require(): Failed opening required 'C:Apache24htdocssymfony.localapp/../vendor/autoload.php' (include_path='.;c:phpincludes') in C:Apache24htdocssymfony.localappautoload.php on line 11
很明显,它正在寻找/vendor/autoload.php
,但这并不存在。为什么我的供应商目录是空的?我如何确保安装库?
$ composer update
返回:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing paragonie/random_compat (1.1.4)
Downloading: 100%
Failed to download paragonie/random_compat from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing paragonie/random_compat (1.1.4)
Cloning d762ee5b099a29044603cd4649851e81aa66cb47
[RuntimeException]
Failed to clone git@github.com:paragonie/random_compat.git via git, https, ssh protocols, aborting.
- git://github.com/paragonie/random_compat.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat'...
fatal: remote composer already exists.
- https://github.com/paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
- git@github.com:paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
嗯,您的PHP配置不正确。
调整您的/etc/php5/php.ini
并启用"ZIP"扩展名。
剩下的可能是权限问题,因为您将Cygwin与Composer结合使用。作曲家和赛文并不是真正的好朋友。
我的建议是:在本机Windows CLI上运行Composer,只针对供应商获取部分。
您想要的是composer update
。它将读取您的composer.json
以安装所有必需的软件包。composer install
用于部署。
下载并启用PHP的zip扩展如果您正在使用PHP7.0并使用debian基本发行版(例如:Ubuntu),请使用以下命令自动安装并启用它
apt-get install php-zip