ant rebuilddb 命令失败 - exec 返回:127
ant rebuilddb command fails - exec returned: 127
当我在项目上执行 ant rebuilddb
命令时,ant 似乎找不到 php 可执行文件。
我收到以下错误:
Buildfile: /var/www/html/aac_test/build.xml
rebuilddb:
[exec] /usr/bin/env: php
[exec] : File or Directory not found (translation by me from German to English)
BUILD FAILED
/var/www/html/aac_test/build.xml:83: exec returned: 127
在我的build.xml中第83行有如下内容
<target name="rebuilddb" description="removes and recreates the database with default development data">
<exec dir="${server}" executable="bin/console" failonerror="true">
<arg value="cache:clear" />
</exec>
...
它应该执行一些 symfony 控制台命令。
哪里 which php
给我 /usr/bin/php
所以我的问题是 - 为什么 ant 找不到 php 可执行文件?
备注:
Vbox 中我的 Dev OS 是 Debian Jessi,安装了 php5-cli,我需要输入 php app/console somecommand
到 运行 symfony 控制台命令。似乎 cli 出了点问题。所有 php5 个组件已移除、清除并重新安装。
我终于自己找到了解决办法。这是 Virtualbox 的问题。 dev vm 的项目目录是来自共享文件夹的符号链接,主机为 Windows 7。
问题是 app/console 文件的格式被 Windows 操纵,所以 Debian 无法以普通方式读取它。
我通过使用 dos2unix console
重新格式化控制台脚本解决了这个问题。
希望对遇到类似问题的小伙伴有所帮助。
当我在项目上执行 ant rebuilddb
命令时,ant 似乎找不到 php 可执行文件。
我收到以下错误:
Buildfile: /var/www/html/aac_test/build.xml
rebuilddb:
[exec] /usr/bin/env: php
[exec] : File or Directory not found (translation by me from German to English)
BUILD FAILED
/var/www/html/aac_test/build.xml:83: exec returned: 127
在我的build.xml中第83行有如下内容
<target name="rebuilddb" description="removes and recreates the database with default development data">
<exec dir="${server}" executable="bin/console" failonerror="true">
<arg value="cache:clear" />
</exec>
...
它应该执行一些 symfony 控制台命令。
哪里 which php
给我 /usr/bin/php
所以我的问题是 - 为什么 ant 找不到 php 可执行文件?
备注:
Vbox 中我的 Dev OS 是 Debian Jessi,安装了 php5-cli,我需要输入 php app/console somecommand
到 运行 symfony 控制台命令。似乎 cli 出了点问题。所有 php5 个组件已移除、清除并重新安装。
我终于自己找到了解决办法。这是 Virtualbox 的问题。 dev vm 的项目目录是来自共享文件夹的符号链接,主机为 Windows 7。
问题是 app/console 文件的格式被 Windows 操纵,所以 Debian 无法以普通方式读取它。
我通过使用 dos2unix console
重新格式化控制台脚本解决了这个问题。
希望对遇到类似问题的小伙伴有所帮助。