[英]Installing PHP Project Dependencies with Composer
I am trying to install Nette2.3.1 using Composer (on XAMPP). 我正在尝试使用Composer(在XAMPP上)安装Nette2.3.1。 In c:\\x\\php folder I run this command:
在c:\\ x \\ php文件夹中,运行以下命令:
composer create-project nette/sandbox myprojectname
When I do this, getting following error: 当我这样做时,出现以下错误:
[Seld\\JsonLint\\ParsingException] "c:\\x\\php\\php.exe" does not contain valid JSON Parse error on line 1: MZÉ ♥ ♦ ╕ ^ Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
[Seld \\ JsonLint \\ ParsingException]“ c:\\ x \\ php \\ php.exe”在第1行上不包含有效的JSON解析错误:MZÉ♥♦^ ^预期之一:“ STRING”,“ NUMBER”,“ NULL” , '真假', '{', '['
I tried all these options to no avail: 我尝试了所有这些选项都无济于事:
This was what went wrong: 这是出问题的地方:
I installed xampp while anti-virus is running - i got a warning but chose to ignore that. 我在运行防病毒软件时安装了xampp-我收到警告,但选择忽略该警告。 Consequently php.exe was corrupted and messed up the whole thing for me.
因此,php.exe损坏并为我弄乱了整个内容。
PATH variables under my user wasn't updated with php.exe path. 我的用户下的PATH变量未使用php.exe路径更新。 Though system variable is updated, it is still a mystery to me why this became an issue.
尽管系统变量已更新,但对我来说仍然是一个谜,为什么这成为问题。
How I did to correct this: 我如何纠正此问题:
Removed xampp altogether, cleared composer cache and installed wamp this time and created project for nette sandbox. 完全删除了xampp,清除了作曲家缓存,这次安装了wamp,并为nette沙箱创建了项目。 This worked fine.
这很好。 In all fairness xampp would have worked as well had I installed it with av disabled and PATH variables properly updated.
公平地说,如果我在禁用av并正确更新PATH变量的情况下进行安装,xampp也会正常工作。
I think your composer PATH or shortcut/batch file is kind of broken, because it tries to read the php.exe file as a JSON file. 我认为您的作曲者PATH或快捷方式/批处理文件已损坏,因为它尝试将php.exe文件读取为JSON文件。
Try to remove composer completely and start with a clean install 尝试完全删除composer并开始进行全新安装
composer create-project nette/sandbox myprojectname
command in any directory composer create-project nette/sandbox myprojectname
命令 Documentation - windows installation of composer 文档-Windows Composer安装
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.