dongmaxi6763
2017-09-16 07:39
浏览 181
已采纳

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

This morning while trying to create a new laravel project I got the error

/c/xampp/php/php: line 13: /opt/php/bin/php: No such file or directory

I can still update composer, however most other commands throw the same error. 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?

Any help would be greatly appreciated

Update

Fresh copy of php solved the issue

图片转代码服务由CSDN问答提供 功能建议

今天早上,在尝试创建一个新的laravel项目时,我收到了错误</ p>

/ c / xampp / php / php:第13行:/ opt / php / bin / php:没有这样的文件或目录</ p> </ blockquote>

I 仍然可以更新作曲家,但大多数其他命令会抛出相同的错误。 并且直到今天早上才对作曲家有任何问题。</ p>

看了一下这些文件我认为我发现底部的罪魁祸首</ p>

 #!/ bin / bash 
 
#获取此脚本文件的目录,同时解析符号链接:
#(参考:Dave Dopson,http://stackoverflow.com/questions/  59895 / can-a- 
bash-script-tell-what-directory-its-stored-in)
 SOURCE =“$ {BASH_SOURCE [0]}”
而[h“$ SOURCE”];  do#resolve $ SOURCE,直到文件不再是
symlink 
DIR =“$(cd -P”$(dirname“$ SOURCE”)“&amp;&amp; pwd)”
 SOURCE =“$(readlink”$ SOURCE  “)”
 [[$ SOURCE!= / *]]&amp;&amp;  SOURCE =“$ DIR / $ SOURCE”#如果$ SOURCE是相对
symlink,我们需要相对于符号链接文件
所在的路径解析它
done 
__DIR __ =“$(cd -P”$(dirname)  “$ SOURCE”)“&amp;&amp; pwd”“
 
 / opt / php / bin / php”-c $ __ DIR __ / stdlib“”$ @“
 </ code> </ pre> 
 \  n 

其他链接建议smylinking到php所在的目录,但是我有点困惑,因为这不会导致/ c / xampp / php / php回复自身? </ p>

非常感谢任何帮助</ p>

更新</ strong> </ p>

新鲜副本 php解决了问题</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题