passthru doesn't work in Xampp 1.7.5

Problems with the Linux version of XAMPP, questions, comments, and anything related.

passthru doesn't work in Xampp 1.7.5

Postby ckiran04 » 02. January 2012 07:18

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
ckiran04
 
Posts: 3
Joined: 02. January 2012 07:05
Operating System: LINUX fedora 10

Re: passthru doesn't work in Xampp 1.7.5

Postby JonB » 02. January 2012 22:36

Now how exactly would you propose PHP to run as an executable - 'in the background'?

:shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: passthru doesn't work in Xampp 1.7.5

Postby ckiran04 » 03. January 2012 06:08

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.
ckiran04
 
Posts: 3
Joined: 02. January 2012 07:05
Operating System: LINUX fedora 10

Re: passthru doesn't work in Xampp 1.7.5

Postby JonB » 03. January 2012 07:51

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
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: passthru doesn't work in Xampp 1.7.5

Postby ckiran04 » 04. January 2012 04:18

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 .
ckiran04
 
Posts: 3
Joined: 02. January 2012 07:05
Operating System: LINUX fedora 10

Re: passthru doesn't work in Xampp 1.7.5

Postby JonB » 04. January 2012 15:04

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
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 16 guests