PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
(using Windows XP)
I am running a php-script and during execution it is starting another php-script (myPHP_script.php). This second php-script is running in the background and everything is working fine when i start the initial php-script from the command line. The problem starts when i try to run the php-script with Explorer or some other web-browsers -> the system then begin using a total of 100% CPU. I have tried to start "calc.exe" instead of "php myPHP_script.php" and then everything seems to be ok.
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run("php myPHP_script.php", 3, false);
I do not know what might be wrong and i would be wery pleased if anyone could help me solve this.
PS. I have also tried to use shell_exec() but the same problem occured. And in adition i didn't manage to use shell_exec() for having a process running in the background.
my php-script doesnt do anything else than echo'ing 'Hello'. The script is supposed be continously checking some weather data, but when a simple hello halts the initial script i havent started on this. Have also tried to run a python script from the initial php-script but the result is the same.
My code is simply:
I am not able to run any php or python scripts from the initiating php-script. But .exe files are ok. Also all, php, python and .exe are ok if the initiating php-script is started from the shell. The problem occurs when i run the initiating php-script from a web-browser!
the '-f' didnt help, but i forgot to tell that what i am making is a web page residing in an apache server. From this page i want to start another php-script. Maybe the problem is the path. My apache-server'root is in 'web'
Do you have the php installation folder correctly added to the path environament variable in windows so that you can just call php.exe without giving a full path? - Also... you say CPU hits 100%... but does the script ever execute?
the environment-variable is set, I just use php (not the whole path).
I do think that the path I am using will not be correct from the apachservers point of view, since everything is working when i'm running it locally from my terminal.
But I don't know what other path I should use... The apache root is 'C:\web', and the files resides in 'C:\web\komponents'
And you are right, the script does not execute. I guess it is not found?