php - Symfony 安装缺少的供应商库

标签 php symfony doctrine-orm composer-php

我全新安装了 Symfony,除了我的 vendors 目录是空的外,一切看起来都在原地?也就是说,它有 composer 和 doctrine 目录,但它们是空的。如果我站在根目录下运行命令:

$ 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:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11

Fatal error: require(): Failed opening required 'C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php' (include_path='.;c:\php\includes') in C:\Apache24\htdocs\symfony.local\app\autoload.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 结合使用。 Composer 和 Cygwin 并不是真正最好的 friend 。

我的建议:在 native Windows CLI 上运行 Composer,仅用于供应商获取部分。

关于php - Symfony 安装缺少的供应商库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34295062/

相关文章:

mysql - Doctrine 将子查询值添加到实体虚拟属性

php - symfony Doctrine 顺序

php - Doctrine2 基础;代理、存储库

php - 需要设置商家ID

php - 如何交换php变量字符

php - 如何在 zf2 中获取 Controller 和 Action 名称

php - Windows 上的 Doctrine Cli

php - 如何从订单详细信息页面删除产品链接?

php - Symfony 2.1 扩展核心类

mysql - NOT IN 用于多字段 DQL Doctrine2