简体   繁体   English

composer php:没有这样的文件或目录

[英]composer php: No such file or directory

This morning while trying to create a new laravel project I got the error 今天早晨,当尝试创建一个新的laravel项目时,出现了错误

/c/xampp/php/php: line 13: /opt/php/bin/php: No such file or directory / c / xampp / php / php:第13行:/ opt / php / bin / php:无此类文件或目录

I can still update composer, however most other commands throw the same error. 我仍然可以更新composer,但是大多数其他命令会抛出相同的错误。 And haven't had any problems with composer till this morning. 直到今天早上,作曲家都没有遇到任何问题。

after having a look at one of the files I (think I) found the culprit at the bottom 在查看了其中一个文件(我认为是)之后,找到了罪魁祸首

#!/bin/bash

# Gets the directory of this script file, also resolving symlinks:
# (reference: Dave Dopson, http://stackoverflow.com/questions/59895/can-a-
bash-script-tell-what-directory-its-stored-in )
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a 
symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative 
symlink, we need to resolve it relative to the path where the symlink file 
was located
done
__DIR__="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

/opt/php/bin/php "-c$__DIR__/stdlib" "$@"

Other links suggest smylinking to the directory where php is, however I'm a little confused as wouldn't that lead to the /c/xampp/php/php referring back to itself? 其他链接建议smylinking到php所在的目录,但是我有点困惑,因为这不会导致/ c / xampp / php / php指向自身吗?

Any help would be greatly appreciated 任何帮助将不胜感激

Update 更新

Fresh copy of php solved the issue php的新副本解决了该问题

php的新副本解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM