dongshuao2309 2017-04-14 06:57
浏览 99

Laravel Vagrant在PHP CLI中运行artisan命令

I am using Laravel 5.4 with Homestead vagrant and running my app on vagrant where i run tests like vagrant@homestead:~/ticketApp$ php artisan dusk and it works fine. currently i need to apply a hack where i put a check in my code that

if ('cli' === PHP_SAPI) {
   // do something
}

and run the command php php artisan dusk but the condition 'cli' === PHP_SAPI didn't return true and when i print the PHP_SAPI it returns the fpm-cgi.

whereas i was expecting that PHP_SAPI will return cli.

Please help how i'll run my tests to make this condition true

  • 写回答

2条回答 默认 最新

  • dongmi6102 2017-04-14 07:10
    关注

    Try run command

    php-cli artisan dusk
    
    评论

报告相同问题?

悬赏问题

  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 spring后端vue前端
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题