Re: [PHP] exec() problem

2009-11-14 Thread Ashley Sheridan
On Sat, 2009-11-14 at 22:20 +0100, A. Mannini wrote:

 Hi all,
 
 i've a problem using exec() on a Linux server with PHP 5.2.9 on Apache 
 2.2.13. Safe mode is OFF and Apache isn't chrooted.
 
 I would run /usr/lib/mailman/bin/find_member -l list email so i used 
 exec(sudo run /usr/lib/mailman/bin/find_member -l list 
 email,$output) and set /etc/sudoers with apache ALL=NOPASSWD: 
 /usr/lib/mailman/bin/find_memberbut it doesn't work.
 
 I tried simple commands /bin/ls works, sudo -V work but sudo 
 /bin/ls doesn't work.
 
 I get return code 1 and no messages in logs..
 
 What is worng?
 
 Thanks
 
 Alessandro
 


Did you mean to put 'run' into the exec call?

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] exec() problem

2009-11-14 Thread A. Mannini

Ashley Sheridan ha scritto:


Have you checked to ensure that the exec is actually running at all? 
Check the error logs to see what they say. There may be a problem with 
the string argument for exec(), like an unescaped character that is 
causing an issue


Thanks,
Ash
http://www.ashleysheridan.co.uk




Yes i had no messages in Apache logs so i tried to use error_log in 
php.ini but again no messages.
Don't know if there is a way to see what php module interpeter and try 
to execute.


Thanks

Alessandro

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] exec() problem

2009-11-14 Thread Ashley Sheridan
On Sun, 2009-11-15 at 00:06 +0100, A. Mannini wrote:

 Ashley Sheridan ha scritto:
 
  Have you checked to ensure that the exec is actually running at all? 
  Check the error logs to see what they say. There may be a problem with 
  the string argument for exec(), like an unescaped character that is 
  causing an issue
 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 Yes i had no messages in Apache logs so i tried to use error_log in 
 php.ini but again no messages.
 Don't know if there is a way to see what php module interpeter and try 
 to execute.
 
 Thanks
 
 Alessandro
 


I think for something like that, you should be looking at your system
logs, as that's likely where the errors would log.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] exec() problem

2009-11-14 Thread A. Mannini

Ashley Sheridan ha scritto:

On Sun, 2009-11-15 at 00:06 +0100, A. Mannini wrote:


Ashley Sheridan ha scritto:
Have you checked to ensure that the exec is actually running at all? 
Check the error logs to see what they say. There may be a problem with 
the string argument for exec(), like an unescaped character that is 
causing an issue


Thanks,
Ash
http://www.ashleysheridan.co.uk


Yes i had no messages in Apache logs so i tried to use error_log in 
php.ini but again no messages.
Don't know if there is a way to see what php module interpeter and try 
to execute.


Thanks

Alessandro




I think for something like that, you should be looking at your system
logs, as that's likely where the errors would log.

Thanks,
Ash
http://www.ashleysheridan.co.uk





Looked to all log...nothing! :-(

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] exec() problem

2009-11-14 Thread Ashley Sheridan
On Sun, 2009-11-15 at 00:25 +0100, A. Mannini wrote:

 Ashley Sheridan ha scritto:
  On Sun, 2009-11-15 at 00:06 +0100, A. Mannini wrote:
  
  Ashley Sheridan ha scritto:
  Have you checked to ensure that the exec is actually running at all? 
  Check the error logs to see what they say. There may be a problem with 
  the string argument for exec(), like an unescaped character that is 
  causing an issue
 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
  Yes i had no messages in Apache logs so i tried to use error_log in 
  php.ini but again no messages.
  Don't know if there is a way to see what php module interpeter and try 
  to execute.
 
  Thanks
 
  Alessandro
 
  
  
  I think for something like that, you should be looking at your system
  logs, as that's likely where the errors would log.
  
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
  
  
  
 
 Looked to all log...nothing! :-(
 


What other logs did you look at?

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] exec() problem

2009-11-14 Thread Kim Madsen

Ashley Sheridan wrote on 2009-11-15 00:23:


Looked to all log...nothing! :-(




What other logs did you look at?


Then do this from a command line:

su - the user apache runs as

copy the command from the ph script and run it from commandline and let 
us see the error you recieve...


--
Kind regards
Kim Emax - masterminds.dk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] exec() problem

2009-11-14 Thread A. Mannini

Ashley Sheridan ha scritto:

On Sun, 2009-11-15 at 00:06 +0100, A. Mannini wrote:


Ashley Sheridan ha scritto:
Have you checked to ensure that the exec is actually running at all? 
Check the error logs to see what they say. There may be a problem with 
the string argument for exec(), like an unescaped character that is 
causing an issue


Thanks,
Ash
http://www.ashleysheridan.co.uk


Yes i had no messages in Apache logs so i tried to use error_log in 
php.ini but again no messages.
Don't know if there is a way to see what php module interpeter and try 
to execute.


Thanks

Alessandro




I think for something like that, you should be looking at your system
logs, as that's likely where the errors would log.

Thanks,
Ash
http://www.ashleysheridan.co.uk





Ok i found that Fedora has, as default, a line Defaults requiretty in 
/etc/sudoers, i disabled that but i get a different message.


sudo: no tty present and no askpass program specified


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] exec() problem [SOLVED]

2009-11-14 Thread A. Mannini

Ashley Sheridan ha scritto:

On Sun, 2009-11-15 at 00:06 +0100, A. Mannini wrote:


Ashley Sheridan ha scritto:
Have you checked to ensure that the exec is actually running at all? 
Check the error logs to see what they say. There may be a problem with 
the string argument for exec(), like an unescaped character that is 
causing an issue


Thanks,
Ash
http://www.ashleysheridan.co.uk


Yes i had no messages in Apache logs so i tried to use error_log in 
php.ini but again no messages.
Don't know if there is a way to see what php module interpeter and try 
to execute.


Thanks

Alessandro




I think for something like that, you should be looking at your system
logs, as that's likely where the errors would log.

Thanks,
Ash
http://www.ashleysheridan.co.uk





Ok commenting out Defaults requiretty now it works!

The second message 
sudo: no tty present and no askpass program specified was due to wrong 
command issued during tests.


Many thanks

Alessandro

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] exec problem

2002-08-27 Thread Andrew Brampton

If you are trying to receive the output of the command line you can use the
backtick notation
$list = `ls`;

Hope that helps
Andrew

Mark [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i'm basicly trying to execute an executeable with this following script.

 $command = ../theApp/theapp;
 exec ( $command ,  $ValueIn,  $ValueOut);
 echo $ValueOut;

 I'm getting a value of 0 returned, but from a command line the executable
 works fine and does what it is suposed to do is there any other way i can
do
 this or ami i doing it work ??

 Cheers



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php