duansha8764 2012-01-26 21:25
浏览 35
已采纳

.htaccess阻止cron请求?

I set up my IX Webhosting to conduct the following cronjob every 15 minutes.

usr/bin/wget -O- http://xxx.com/php/xxx.php

I want the php folder to be blocked off from all outside requests for security reasons, so I set the .htaccess file to deny from all. But when the .htaccess file is present the cron job is denied with a 403 error.

I thought that server-side cronjobs are not blocked by .htaccess? Is there any way to get around this?

  • 写回答

3条回答 默认 最新

  • dsn46282 2012-01-26 21:27
    关注

    Change the cron job to:

    /usr/bin/php /path/to/web/root/php/greader_forceupdate.php xxxx
    

    /usr/bin/php may need to be adjusted if PHP is installed elsewhere.
    /path/to/web/root is the path on the filesystem.

    To access the parameter, use $_SERVER['argv'][1].

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1