我在 Propel ORM 配置过程中遇到问题。
我按照这个配置文件在我的 Vagrant 上使用 PHP 7.1 准备了环境:
# Install software
add-apt-repository ppa:ondrej/php
apt update
apt install python-software-properties
apt update
apt install -y apache2
apt install -y php
apt install -y php-mcrypt
apt install -y php-mysql
apt install -y php-curl
apt install -y php-cli
apt install -y php-xml
apt install -y libapache2-mod-php
apt install -y mc
# install composer, configure Apache and create database
service apache2 restart
/etc/init.d/mysql restart
目前我想安装 Propel ORM。我将 Propel 添加到作曲家,安装,现在我输入(通过 Vagrant 中的 SSH)
/var/www/application/Vendors/bin/propel init
但不幸的是我收到错误:
/usr/bin/env: �php\r’: No such file or directory
我能做些什么来解决它?
编辑: 我运行的文件(未编辑,通过 Composer 安装):
#!/usr/bin/env sh
dir=$(d=${0%[/\\]*}; cd "$d"; cd "../propel/propel/bin" && pwd)
# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# Cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m "$dir");
fi
fi
dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/propel" "$@"