Run a PHP CLI script from a webpage

后端 未结 2 1582
难免孤独
难免孤独 2021-01-19 15:08

I have a (possibly dumb) question. I have a script made in php, constructed for cli usage. Works fine when I run it from the command line, no problem there. The problem is t

2条回答
  •  不知归路
    2021-01-19 15:45

    There are many possibilities why exec() and related function calls are not working for you.

    • Your webhost does not have PHP-CLI installed. Just a webserver module
    • You need to use the full path to the php binary for lack of a decent shell environment. E.g. /usr/bin/php
提交回复
热议问题