I am having trouble with a web page I am creating.
I am trying to call a php program that I normally use from the command line when I shell in.
The cli program works fine.
It is also called from a shell script that is initiated by cron 4 times a day.
I know it works, at least from a basic perspective.
The problem shows up the same way when I try to exec(), shell_exec(), passthru() or system().
What happens is that the web page appears to be executed about 40 times before the webserver kills it for too many db connections.
When I run the calling web page with the system() call removed, it executes and exits normally.
So I tried a very simple php program to call. All it contains isThe result is the same; the calling webpage is executed multiple times...PHP Code:<?php
echo "Hi there";
?>
Depending on which function I use to call the script, I can see multiple occurrences of echo's from the calling webpage.
An example call from the webpage is
exec("php test.php");
I can see many instances of test.php being executed (or trying to be executed) on the server -- I get no output no matter how I try to capture it in the web page's php.
What am I doing wrong here? I could understand it if the called script failed , with pathnames and/or server variables; but how is it the calling webpage/program executes multiple times?
I must be violating something...
I don't want to run this on the server anymore for fear of causing problems for other users.
Any help?
Thanks.


LinkBack URL
About LinkBacks




Reply With Quote
So you've stumped me! But I'll see who's got a minute to take a look and get you in the right direction.



Bookmarks