我正在尝试创建一个全新的Symfony 2.7项目,并按照Symfony Book中的安装说明进行操作。我正在运行Mac OS 10.10.2。我的php版本是5.4。当我尝试使用以下命令创建新项目时:
$ symfony new myproject
我收到以下错误:
PHP Warning: require(phar:///usr/local/bin/symfony/symfony): failed to open stream: phar error: Cannot open temporary file for decompressing phar archive "/usr/local/bin/symfony" file "symfony" in /usr/local/bin/symfony on line 10
Warning: require(phar:///usr/local/bin/symfony/symfony): failed to open stream: phar error: Cannot open temporary file for decompressing phar archive "/usr/local/bin/symfony" file "symfony" in /usr/local/bin/symfony on line 10
PHP Fatal error: require(): Failed opening required 'phar:///usr/local/bin/symfony/symfony' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') in /usr/local/bin/symfony on line 10
Fatal error: require(): Failed opening required 'phar:///usr/local/bin/symfony/symfony' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') in /usr/local/bin/symfony on line 10
过去我使用composer创建了Symfony项目,但没有任何问题。非常感谢任何帮助。
答案 0 :(得分:0)
我使用这些步骤(在Linux下),因为我遇到了同样的错误:
在 public_html
目录中启动这些命令以创建“本地”symfony安装程序文件(而非/usr/local/bin/symfony
,如{{3中的解释}})
curl -LsS http://symfony.com/installer -o symfony
chmod +x symfony
然后使用 php
php symfony demo
或创建一个新的symfony项目
php symfony new project_name
然后访问https://github.com/symfony/symfony-installer或http://localhost/symfony_demo/web/config.php以配置symfony项目
PS :检查文件或目录的权限