doupi1532 2015-12-31 20:11
浏览 18

PHP出错了吗? 浏览器下载空文件

I have a laravel/php script that runs the exec command:

$result = exec($command, $output);
return json_encode($output);

I know exec is dangerous (this is for testing). When I load the page in a browser, the command takes a while and eventually the browser downloads and empty file:

enter image description here

If I comment out the exec command, the page outputs and empty array just fine.

When I use fiddler to see the response I get the following:

HTTP/1.1 200 OK
Date: Thu, 31 Dec 2015 20:08:53 GMT
Server: Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/0.9.8x
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/x-httpd-php
Content-Length: 0

This happens in Chrome and IE.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序