I\'ve a script which check for syntax error in php file using php -l . It works fine in windows but gives incorrect output in Linux:
content of file exec_ip.php whic
After 2 days of headache and lots of googling... i found the solution in the link http://www.mombu.com/php/php-5-forum/t-24759-exec-or-system-et-all-cause-an-infinite-loop-of-starting-requested-program-8469354.html
It was PHP CGI version which reads script name from the environment thus causing my calling script to run infinite number of times or untill the maximum number of allowed process or till whole memory was consumed.
The solution as simply using command php-cli instead of command php.
i replaced below line in my code
exec("php -l ".$tmpfname,$error);
with
exec("php-cli -l ".$tmpfname,$error);
and now everything is fine.
I hope it'll help someone. I've also changed the title of this question so that others people can easily find the solution of same problem in google.