PHP fgetcsv encounters Fatal error: Maximum execution time exceeded on Firefox -
first of guess "fatal error: maximum execution time exceeded" in php server side error , shouldn't depend on browser version, right? seems does!?!
i have code read csv data coming text area in form.
$handle = tmpfile(); fwrite($handle, $csvclip); fseek($handle, 0); while (!feof($handle)) { $r = fgetcsv($handle, 1000, $delimiter, '"'); <---- here gives fatal error print $r[0]; }
and data this, nothing special, 4 columns , 3 rows.
a b 1 2 c d 3 4 e f 5 6
code works on browsers (ie, chrome, e.t.c), can see parsed data except firefox!!!!! tested on different pcs same. browsers ok firefox gives "fatal error: maximum execution time exceeded" line having "fgetcsv"
i'm using php version 5.2.10 , 2 different firefox versions 3.5.16 , 3.6.6
anyone have seen problem before?
edit: code tested on 2 different linux servers centos 5.3 , 5.5, using 2 different pc having browsers.
edit 2: solved
ok found problem. $delimiter value comes having 3 values "," ";" , "\t" browsers display "\t" spaces in , didn't pay attention it.
seems firefox doing \t php doesn't understand it's tab. other browsers sends \t expected.
if hardcode "\t" fgetcsv($handle, 1000, "\t", '"') works fine firefox.
first time firefox caused me trouble , not ie :)
add following top of script:
set_time_limit(0);
this should disable time limit script run.
Comments
Post a Comment