PHP & cron: security issues

后端 未结 6 1290
孤城傲影
孤城傲影 2021-01-02 16:44

Whats the best way to ensure that only CRON executes PHP scripts, and not someone else who stumbled upon your php scripts..

I was thinking a Password Variable.... bu

6条回答
  •  鱼传尺愫
    2021-01-02 16:57

    You can send params to a PHP file via the command line. Just not like you are thinking.

    http://www.php.net/manual/en/reserved.variables.argc.php

    However, you also want to keep this out of the public html folder, like the others are saying. So you CAN'T surf to them. PHP run from command line doesn't need to be in any kind of webserver watch folder.

提交回复
热议问题