Page 1 of 1
passthru doesn't work in Xampp 1.7.5
Posted:
02. January 2012 07:18
by ckiran04
Hi,
I have installed Xampp1.7.5 in my linux system(Ferdora 10 ).
I have a requirement in which PHP script has to run in back ground.
I am using this passthru
<?php
passthru("/usr/bin/php /path/to/script.php ".$argv_parameter." >> /path/to/log_file.log 2>&1 &");
?>
PHP is not running in Back ground. When i am executing it manually it is working fine.
Can some one help me in resolving this issue
Re: passthru doesn't work in Xampp 1.7.5
Posted:
02. January 2012 22:36
by JonB
Now how exactly would you propose PHP to run as an executable - 'in the background'?
Re: passthru doesn't work in Xampp 1.7.5
Posted:
03. January 2012 06:08
by ckiran04
I have created a PHP file Transfer.php with content ::
?php
passthru("/opt/lampp/bin/php /path/to/script.php ".$argv_parameter." >> /path/to/log_file.log 2>&1 &");
?>
when i am executuing the Transfer.php file by using a command
"/opt/lampp/bin/php /path/to/Transfer.php"
The script.php will execute in back ground.
I am trying to invoke the Transfer.php using Dotnet code.
Dotnet code will just login into server using SSH and invoke the command and returns from the Shell.
Re: passthru doesn't work in Xampp 1.7.5
Posted:
03. January 2012 07:51
by JonB
Its a nice idea - but -
in my opinion only - not gonna fly -
Reason - its an executable, not a service - when you break the shell (SSH IS a Shell), the process is effectively abandoned.
Good luck
Re: passthru doesn't work in Xampp 1.7.5
Posted:
04. January 2012 04:18
by ckiran04
jon:
Actually when we pass this command it works in backgroud if we break the shell. there is no issue with that.
Actually i have 2 linux servers one(Server1 ) with LAMPP and another (server2 )with PHP,apache and MYSQL installed as a services.
this script is working fine with the sever2 . the issue is only with the server1. Is there any time out settings in the LAMPP .
Re: passthru doesn't work in Xampp 1.7.5
Posted:
04. January 2012 15:04
by JonB
and another (server2 )with PHP, apache and MYSQL installed as a services.
Exactly
And LAMPP is a bash script that you execute.
The only way to grok what might or might not work is to examine that script.
Good Luck