我正在尝试部署Laravel 4应用程序,但工匠没有显示任何命令。为什么?

时间:2014-04-30 19:18:38

标签: deployment laravel-4

我第一次将Laravel 4应用程序部署到共享主机并运行composer install,但它失败并显示以下消息:

Script php artisan clear-compiled handling the post-install-cmd event returned with an error

    [RuntimeException]
    Error Output:

        [InvalidArgumentException]
        Command "clear-compiled" is not defined.

当我运行命令php artisan list时,我没有得到预期的工匠命令列表,只有:

Available commands:
    help              Displays help for a command
    list              Lists commands
    workbench         Create a new package workbench

所有依赖项文件都已正确安装在vendor文件夹中。

为什么Laravel的标准工匠命令不可用?

1 个答案:

答案 0 :(得分:4)

问题是我的主机上的php命令没有运行php的CLI版本。当我运行命令php-cli artisan list时,我得到了预期的Laravel工匠命令列表。

要让作曲家正确地调用它,那么,我只需要更新“脚本”'我的composer.json中的部分使用php-cli而不是普通php

(作为旁注,作曲家用这条消息吐出了类似的警告:Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI