1

I have an application where I need to run a PHP script by exec() function of php.

"php /var/www/server/data/scripts/ThreadHandler.php 145596 > /var/www/server/data/logs/threads/thread.145596.log 2>&1 &"

also tried

"php /var/www/server/data/scripts/ThreadHandler.php 145596 > /var/www/server/data/logs/threads/thread.145596.log 2>&1 "

I am running above command with exec() function of PHP, but it is not getting run, I can't track any error. please suggest any change.

1
  • @codaddict, he is can't track any error Commented Feb 24, 2011 at 11:37

2 Answers 2

1

try

passthru('php -f /var/www/server/data/scripts/ThreadHandler.php 145596 > 
         /var/www/server/data/logs/threads/thread.145596.log 2>&1');

Also, try to run it from linux command line

Sign up to request clarification or add additional context in comments.

1 Comment

I have tried from linux command , It was error of "threads" folder's writing permission. thanks :)
1

Try defining $output and $return_var arguments for exec and print their values :

$output = array();
$rv = null;
exec("your command", $output, $rv);
print_r($rv);
print_r($output);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.