[PHP] exec() system() passthru() problems. (S.u.S.E 7.2)

2001-10-03 Thread Edward Woodstarf

Hi,
I was wondering if someone could HELP I'm very new to php and I am 
trying to get the application functions to start an instance of a program. 
However no matter what I do the functions return -1. Even if I add the 
absoulte path it still returns -1. nothing happens. I'm running S.u.S.E 7.2 
php4. I was wondering if I have missed something in a config file. If i su 
to nobody (I think this is the user apache runs as on S.u.S.E) and run ps it 
works fine as the user has permissions for it.
I am completely baffled I have tried multiple examples from books that all 
say it should work but I always get -1. could someone help before my brain 
turns into a cabbage.

Ta,

E.



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] exec() system() passthru() problems. (S.u.S.E 7.2)

2001-10-03 Thread David Robley

On Wed,  3 Oct 2001 20:01, Edward Woodstarf wrote:
 Hi,
 I was wondering if someone could HELP I'm very new to php and I am
 trying to get the application functions to start an instance of a
 program. However no matter what I do the functions return -1. Even if I
 add the absoulte path it still returns -1. nothing happens. I'm running
 S.u.S.E 7.2 php4. I was wondering if I have missed something in a
 config file. If i su to nobody (I think this is the user apache runs as
 on S.u.S.E) and run ps it works fine as the user has permissions for
 it.
 I am completely baffled I have tried multiple examples from books that
 all say it should work but I always get -1. could someone help before
 my brain turns into a cabbage.


Perhaps if you were to show the code you are trying to use?

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Daddy, why doesn't this magnet pick up this floppy disk?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Exec, system, passthru didn't work

2001-07-16 Thread Reuben D Budiardja


Hi,
I tried to execute the following command from the web interface using a 
system call
/usr/bin/play a_wave_file.wav

I tried exec, system, passthru, and shell_exec. None of them worked, that is 
I didn't hear any sound played. Note that I'm sitting here on the server 
itself, and tried it with a web browser in the server. The command is 
executed fine when I just copy it and run it in terminal. I also made sure 
that nothing blocked the sound card, that is, the sound card was not in use.

However, if I tried to run the same file using php as command line, it works 
find.

exec, system, passthru returns the value 2, which I don't know what it means. 

Any help on this will be appreciated. Thanks in advance.

Reuben D. Budiardja


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Exec, system, passthru didn't work

2001-07-16 Thread Rasmus Lerdorf

 I tried to execute the following command from the web interface using a
 system call
 /usr/bin/play a_wave_file.wav

 I tried exec, system, passthru, and shell_exec. None of them worked, that is
 I didn't hear any sound played. Note that I'm sitting here on the server
 itself, and tried it with a web browser in the server. The command is
 executed fine when I just copy it and run it in terminal. I also made sure
 that nothing blocked the sound card, that is, the sound card was not in use.

Does it work from the shell if you su to the web server user id and try to
run it?  99% of shell exec issues are permission-related.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Exec, system, passthru didn't work

2001-07-16 Thread scott [gts]

did you try and capture error messages from the system calls?

webserver probably doesnt have permission to do what you want it to do.

 -Original Message-
 From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Exec, system, passthru didn't work
 
 Hi,
 I tried to execute the following command from the web interface using a 
 system call
 /usr/bin/play a_wave_file.wav
 
 I tried exec, system, passthru, and shell_exec. None of them worked, that is 
 I didn't hear any sound played. Note that I'm sitting here on the server 
 itself, and tried it with a web browser in the server. The command is 
 executed fine when I just copy it and run it in terminal. I also made sure 
 that nothing blocked the sound card, that is, the sound card was not in use.
 
 However, if I tried to run the same file using php as command line, it works 
 find.
 
 exec, system, passthru returns the value 2, which I don't know what it means. 
 
 Any help on this will be appreciated. Thanks in advance.
 
 Reuben D. Budiardja

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Exec, system, passthru didn't work

2001-07-16 Thread Reuben D Budiardja

On Monday 16 July 2001 10:37 am, you wrote:
  On Monday 16 July 2001 09:42 am, you wrote:
I tried to execute the following command from the web interface using
a system call
/usr/bin/play a_wave_file.wav
   
I tried exec, system, passthru, and shell_exec. None of them worked,
that is I didn't hear any sound played. ...
  
   Does it work from the shell if you su to the web server user id and try
   to run it?  99% of shell exec issues are permission-related.
  
   -Rasmus
 
  Yes, I su as root and then su as the web server user id, it worked. I
  also check the permission is already 755.

 Ok, and does this play program actually work without a controlling tty?

I can only guess what you mean here, but I think that's a good point. Maybe 
the play program wouldn't work withough a controlling tty. Do you know how 
to check, or any work around?

Thanks.
Reuben D. Budiardja



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Exec, system, passthru didn't work

2001-07-14 Thread Reuben D Budiardja


Hi,
I tried to execute the following command from the web interface using a 
system call
/usr/bin/play a_wave_file.wav

I tried exec, system, passthru, and shell_exec. None of them worked, that is 
I didn't hear any sound played. Note that I'm sitting here on the server 
itself, and tried it with a web browser in the server. The command is 
executed fine when I just copy it and run it in terminal. I also made sure 
that nothing blocked the sound card, that is, the sound card was not in use.

exec, system, passthru returns the value 2, which I don't know what it means. 

Any help on this will be appreciated. Thanks in advance.

Reuben D. Budiardja

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] exec system passthru

2001-07-09 Thread Plamen Slavov

Sorry if question was asked, but i did not find any information
I use Apache/1.3.20 Win32 PHP/4.0.5 on a Windows ME
I can run commands built in command.com like dir or cd, using system() or passthru(),
but whenever i try to use external command, like pkunzip or gzip, the web server hangs 
and i have to restart my computer
The only solution i found was specifying the commands in a .bat file and running the 
.bat file with system() - which works OK
Someone had the same problem or a possible solution
tahnks
--
Visit our site at http://eshop.bg