Symfony - 无法使用安装程序创建新项目

时间:2015-01-31 00:23:05

标签: php symfony

我正在尝试学习Symfony,但到目前为止,我一直在安装以及除了我的应用程序的实际开发之外的东西。

我尝试使用安装程序在我的Windows机器上创建一个新的Symfony项目。我按照说明in the book完全按照说明进行操作。我可以成功下载symfony.phar,但是当我运行时:

php symfony.phar

我收到以下错误:

PHP Warning:  Phar::mapPhar(symfony.phar): failed to open stream: No such file or directory in symfony.phar on line 9
PHP Stack trace:
PHP   1. {main}() symfony.phar:0
PHP   2. Phar::mapPhar() symfony.phar:9

Warning: Phar::mapPhar(symfony.phar): failed to open stream: No such file or directory in symfony.phar on line 9

Call Stack:
    0.0017     227224   1. {main}() symfony.phar:0
    0.0017     227920   2. Phar::mapPhar() symfony.phar:9

PHP Fatal error:  Uncaught exception 'PharException' with message 'unable to open phar for reading "symfony.phar"' in symfony.phar:9
Stack trace:
#0 symfony.phar(9): Phar::mapPhar('default.phar')
#1 {main}
  thrown in symfony.phar on line 9

Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "symfony.phar"' in symfony.phar on line 9

PharException: unable to open phar for reading "symfony.phar" in symfony.phar on line 9

Call Stack:
    0.0017     227224   1. {main}() symfony.phar:0
    0.0017     227920   2. Phar::mapPhar() symfony.phar:9

我找不到任何有用的东西。

1 个答案:

答案 0 :(得分:2)

原因似乎是在我的Windows命令提示符下,我在C:\Users\Me\My Documents的子目录中。 symfony.phar和Composer都不能在这个目录下工作。它必须来自C:\Users\Me\Documents,这是实际的音乐位置,而不是My Documents,它只是一个虚拟目录。

我不知道为什么它不起作用的技术性。

相关问题