Why am i getting Undefined index: HTTP_HOST error?

后端 未结 2 896
遥遥无期
遥遥无期 2021-01-22 18:05

I am using Facebook SDK to post some test wall post on my own facebook page. It works fine when i run the script on my browser but when i run it from terminal it gives me as err

2条回答
  •  抹茶落季
    2021-01-22 18:10

    If you run your script from a terminal, or a cron job, there is no HTTP environment.

    A possible solution to this is to run the script with a wget http://.../parameters instead of with php scriptname.

提交回复
热议问题