douke9379 2013-05-14 22:03
浏览 27

执行另一个PHP脚本

I have a cron job that calculates the disk space on ServerA

I have a MySQL database on ServerB that stores the disk space values

ServerA in not allowed to access MySQL database on ServerB (Rules out direct MySQL Connect)

ServerA cannot open files on ServerB (Rules out include();)

ServerA and ServerB have no shell_exec() abilities

I've tried header("Location: http://ServerB.com/record.php?disk_space=$disk_space"); using a get method then the receiving file $_REQUEST the values but it only works when run through browser and not when run as a cron job.

I think there are no proper alternatives. But I'm happy with a peculiar or scruffy solution. Please put forward your ideas. TIA

  • 写回答

2条回答 默认 最新

  • doulao1966 2013-05-14 22:07
    关注

    You can hit external scripts directly through a number of HTTP libraries -- as well as file_get_contents().

    See:

    You could even use sockets to make the request:

    Lots of options (more than included here). Easiest, if your needs are simple, is just file_get_contents.

    评论

报告相同问题?

悬赏问题

  • ¥15 socket通信实现多人聊天室疑惑
  • ¥15 DEV-C++编译缺失
  • ¥33 找熟练码农写段Pyhthon程序
  • ¥100 怎么让数据库字段自动更新
  • ¥15 antv g6 力导向图布局
  • ¥15 quartz框架,No record found for selection of Trigger with key
  • ¥15 锅炉建模+优化算法,遗传算法优化锅炉燃烧模型,ls-svm会搞,后面的智能算法不会
  • ¥20 MATLAB多目标优化问题求解
  • ¥15 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数