php fastcgi_finish_request(),带有fastcgi_finish_request()的PHP mod_fcgi;

我想使用fastcgi_finish_request()函数.我在我的服务器上安装了cpanel,PHP和Apache都是通过它配置的.由于我无法手动编辑apache或PHP(因为cpanel),我在WHM中使用easyApache来构建它以获得fastcgi.我看到了一个选项caleld Mod FCGID所以我检查了它.在选中了该选项重建PHP和apache之后,我仍然在调用完成请求函数时调用未定义的函数.

解决方法:

有点晚了,但人们的信息很好.根据我使用PHP 5.5.7的经验.

PHP使用php_mod(标准Apache)

ob_start();

header("Connection: close\r\n");

header('Content-Encoding: none\r\n');

// your code here

$size = ob_get_length();

header("Content-Length: ". $size . "\r\n");

// send info immediately and close connection

ob_end_flush();

flush();

// run other process without the client attached.

对于使用fastCGI和PHP_FPM的PHP:

// your code here

fastcgi_finish_request();

// run other process without the client attached.

请注意,对于我们来说,执行fastcgi_finish_request()后,log_error不再起作用.我认为这是因为与Apache的连接也被切断,它无法与fastCGI通信以记录错误.

标签:php,fastcgi

来源: https://codeday.me/bug/20190712/1444218.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值