0
我自己遇到PHP请求的问题。在示例中,我将使用file_get_contents()
但同样发生了exec('wkhtmltopdf [*SELF*]')
或curl()
对自己的PHP请求
- 让我的名字服务器example.com
- 的Apache2安装
- FastCGI的(多个PHP版本5.3,5.4,5.5,5.6,7.0)
- 现在我有2名假人的脚本
第一脚本
//get-html.php
file_get_contents('http://example.org/index.html')
第二脚本
//get-php.php
file_get_contents('http://example.org/index.php')
测试
1)的命令行:php get-html.php
//成功
2)浏览器:example.org/get-html.php
//成功
1)命令行:php get-php.php
//成功
2)浏览器:example.org/get-php.php
// 超时
我试过未来
- 创建子域像
subdomain.example.org/index.php
有differet PHP版本,get-php.php
和index.php
- 修改/ etc/hosts
- 请求在其他网站(如google.com)//成功
- session_write_close()的file_get_contents()之前和在session_start()右后不会也因此工作
我的犯罪嫌疑人的mod_fastcgi。似乎Apache不能运行2个实例来处理来自它自己的PHP请求。从命令行运行脚本按预期工作。
有没有人有任何建议?
假脚本是否完成?你不使用会话(他们可能会阻止) – Mark
好点Mark。忘了提及。我也试过session_write_close();的file_get_contents( 'http://example.org/index.php');在session_start();但那也不成功。现在更新'我接下来尝试的'部分。 – Nedvajz
请不要现在开始会话(或者根本不使用它),然后再试一次,如果问题是由阻塞会话或其他事件引起的,那么这将回答我们的问题。 – Mark