【发布时间】:2018-02-25 08:20:39
【问题描述】:
今天早上在尝试创建一个新的 laravel 项目时遇到了错误
/c/xampp/php/php:第13行:/opt/php/bin/php:没有这样的文件或目录
我仍然可以更新 composer,但是大多数其他命令都会抛出相同的错误。直到今天早上,作曲家还没有遇到任何问题。
在查看了其中一个文件后,我(我认为我)在底部找到了罪魁祸首
#!/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" "$@"
其他links 建议链接到php 所在的目录,但是我有点困惑,因为这不会导致/c/xampp/php/php 引用自身吗?
任何帮助将不胜感激
更新
新的php副本解决了这个问题
【问题讨论】:
-
然后关闭问题或自己回答...
-
谢谢萨尔克特。长期用户第一次提问,以后会记住的。
标签: php composer-php