PHP refuses to output data from var_dump, print, etc

淺唱寂寞╮ 提交于 2019-12-05 14:42:14
Vizzy

Have you tried:

ob_start();  
var_dump("Var_dump($res) output in a string");  
$out = ob_get_clean();  
echo $out;  

var_dump by itself wasn't working for me either on WAMP and ob_start/ob_get_clean worked.

Looks like there is an error before the var_dump line, and your PHP is not configured to display errors. Try adding/updating these lines in php.ini, and restart Apache:

display_errors = On
display_startup_errors = On

If you on windows 7, then it support ipv6 by default and localhost != 127.0.0.1 May be if you start server on 127.0.0.1 ( by configuration or inserting in "hosts" file "127.0.0.1 localhost"), then problem was solved? - as assumption.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!