Solutions for php echo not displaying: 1. Add cache characters; 2. Clear the cache; 3. Clear the data cached by the server through "ob_end_clean()"; 4. Increase the timeout setting; 5. Just delete QS_SrvMinDataRate in httpd.conf.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
PHP echo does not display another one during debugging One reason
When executing a long-term PHP program, the intermediate ECHO does not output.
General solutions: add cache characters, clear cache, etc.
echo str_pad('', 1024*4); flush(); ob_flush();
ob_end_clean() Silently clears the data cached on the server side. Other methods
also increase the timeout setting.
set_time_limit(0); ini_set("max_execution_time",0);
When none of the above works, you can check the APACHE log to see if the QOS module has security filtering settings.
Test method, you can use
for ($i=0;$i<30;$i++){ echo $i. flush(); sleep(1); }
to see if it can be executed for 30 seconds. If not, there is a problem with the server.
Usually in httpd.conf, there may be QS_SrvMinDataRate 150 1200 causing truncation. Just remove it.
[Recommended learning: PHP video tutorial]
The above is the detailed content of What should I do if php echo does not display?. For more information, please follow other related articles on the PHP Chinese website!