Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-19 Thread Richard Lynch
On Sat, January 19, 2008 11:24 am, Apple wrote: > Richard Lynch l-i-e.com> writes: > >> They also won't have your same environment, e.g., home directory >> $HOME. >> >> Check permissions on all files/directories. >> >> Use complete pathnames from the root hard drive: >> /home/apple/path/to/$

[PHP] Re: system command runs application, but application doesn't work correctly

2008-01-19 Thread Apple7777
Nathan Nobbe gmail.com> writes: > have you tried a trivial call to mencoder, like i suggested? > it looks like you were passing a lot of parameters to it in the code you > first > posted. try starting out w/ something simple and get that working before > going > for the full blown finished versi

Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-19 Thread Nathan Nobbe
On Jan 19, 2008 12:24 PM, Apple <[EMAIL PROTECTED]> wrote: > Richard Lynch l-i-e.com> writes: > > > They also won't have your same environment, e.g., home directory $HOME. > > > > Check permissions on all files/directories. > > > > Use complete pathnames from the root hard drive: > > /home/ap

[PHP] Re: system command runs application, but application doesn't work correctly

2008-01-19 Thread Apple7777
Richard Lynch l-i-e.com> writes: > They also won't have your same environment, e.g., home directory $HOME. > > Check permissions on all files/directories. > > Use complete pathnames from the root hard drive: > /home/apple/path/to/$outputFile I do that. All permissions (files and directories) a

Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-19 Thread Richard Lynch
On Fri, January 18, 2008 4:49 pm, Apple wrote: > I wonder is it possible to run system() command, so mencoder will run > as from > root (user "500") and not PHP (user "43"). No. system() versus exec() has nothing to do with which user runs it. They only differ in how they handle input/output

Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-19 Thread Richard Lynch
When you run it from the shell, you are you. When you run it from a PHP web-server, you are not you. You are whatever user is configured in httpd.conf That user will not have the same rights/permissions as you do. They also won't have your same environment, e.g., home directory $HOME. Check pe

Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-18 Thread Daniel Brown
On Jan 18, 2008 5:49 PM, Apple <[EMAIL PROTECTED]> wrote: > Daniel Brown gmail.com> writes: > > > > > On Jan 17, 2008 6:48 PM, Apple gmail.com> wrote: > > > Another strange thing is I run ImageMajick with system() in a lot > of scripts on > > > the same server and everything works fine. >

[PHP] Re: system command runs application, but application doesn't work correctly

2008-01-18 Thread Apple7777
Daniel Brown gmail.com> writes: > > On Jan 17, 2008 6:48 PM, Apple gmail.com> wrote: > > Another strange thing is I run ImageMajick with system() in a lot of scripts on > > the same server and everything works fine. > > > > What is the problem? Do you have any idea? > > Does the UID (

[PHP] Re: system command runs application, but application doesn't work correctly

2008-01-18 Thread Apple7777
Daniel Brown gmail.com> writes: > Does the UID (or at least GID) under which PHP is being executed > have permissions to write to the area you're trying to save the file? > > Similar to above, does it have the correct permissions to read the > incoming file? Daniel, I'm not sure about U

Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-18 Thread Daniel Brown
On Jan 17, 2008 6:48 PM, Apple <[EMAIL PROTECTED]> wrote: > Another strange thing is I run ImageMajick with system() in a lot of scripts > on > the same server and everything works fine. > > What is the problem? Do you have any idea? Does the UID (or at least GID) under which PHP is being

[PHP] Re: system command runs application, but application doesn't work correctly

2008-01-17 Thread Apple7777
Richard Lynch l-i-e.com> writes: > > Try writing a 2-line .sh (shell) script that does what you want, and > call that 2-liner from exec(). Thanks for idea, Richard. But it doesn't work. I wrote code as you said: $first = "/usr/local/bin/mencoder -vf scale=448:-3,expand=4

Re: [PHP] Re: system command runs application, but application doesn't work correctly

2008-01-17 Thread Richard Lynch
Try writing a 2-line .sh (shell) script that does what you want, and call that 2-liner from exec(). On Thu, January 17, 2008 6:46 am, Apple wrote: > Daniel Brown gmail.com> writes: > >> Try replacing system() with die() and letting it print out the >> information full command string. Tha

[PHP] Re: system command runs application, but application doesn't work correctly

2008-01-17 Thread Apple7777
Daniel Brown gmail.com> writes: > Try replacing system() with die() and letting it print out the > information full command string. That may give you an idea of a > variable that's either incorrect or undefined. If you copy and paste > it and run the command from the command line and it wor

[PHP] Re: System wide variable

2007-05-23 Thread Al
Take a look at SQLite Darren Whitlen wrote: Hi, I have a PHP script that reads and updates either a small file or a mysql database. This script is called from several places every .5 seconds. I would like to move this file to a variable for extra speed as the file is causing a few problems

[PHP] Re: System wide variable

2007-05-23 Thread Kostas Papadimitriou
Darren Whitlen wrote: Hi, I have a PHP script that reads and updates either a small file or a mysql database. This script is called from several places every .5 seconds. I would like to move this file to a variable for extra speed as the file is causing a few problems being accessed so many

Re: [PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Richard Lynch
On Mon, August 14, 2006 12:25 pm, Michael Jonsson wrote: > I can run any external program like ls, cp, uptime... > But if a try to run my shell script a get error. > > $passwdexe = "sudo /usr/bin/webpasswd"; > $user=$_POST[name]; > $passwd="$passwdexe $user 123456"; >

Re: [PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread p . willis
Quoting Adam Zey <[EMAIL PROTECTED]>: > > Looking at your $command, there is no path in front of it. It's likely > that PHP's shell doesn't have the program in its PATH. Try manually > specifying the full path to the command: > > $command="/home/peter/myprog $arg1 $arg2 > textfile.txt"; > > (

Re: [PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread p . willis
Yes, that is a similar problem and sounds very much like what I am experiencing. Peter Quoting Michael Jonsson <[EMAIL PROTECTED]>: > Hi, > > I can run any external program like ls, cp, uptime... > But if a try to run my shell script a get error. > > $passwdexe = "sudo /usr/bin/webpa

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Michael Jonsson
No, it not on... safe_mode Off Off safe_mode_exec_dir no valueno value safe_mode_gid Off Off safe_mode_include_dir no valueno value .M Adam Zey wrote: Michael Jonsson wrote: Hi, I can run any external program like ls, cp, uptime... But if a try to run

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Adam Zey
Michael Jonsson wrote: Hi, I can run any external program like ls, cp, uptime... But if a try to run my shell script a get error. $passwdexe = "sudo /usr/bin/webpasswd"; $user=$_POST[name]; $passwd="$passwdexe $user 123456"; echo $passwd; $result = s

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Michael Jonsson
Hi, I can run any external program like ls, cp, uptime... But if a try to run my shell script a get error. $passwdexe = "sudo /usr/bin/webpasswd"; $user=$_POST[name]; $passwd="$passwdexe $user 123456"; echo $passwd; $result = system($passwd); Resulta

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Adam Zey
[EMAIL PROTECTED] wrote: Hello, I am trying the run an external application with command line arguments using PHP under linux. ie: $command="myprog $arg1 $arg2 > textfile.txt"; system("echo \"$command\" > test.txt"); system($command); $handle=fopen("textfile.txt","r"); if($handle!=NULL) {

Re: [PHP] Re: System specific information gathering

2005-07-24 Thread André Medeiros
Or that... :P On 7/24/05, Joe Wollard <[EMAIL PROTECTED]> wrote: > As always, look for someone else's existing project and see how they > did it. ;-) > > http://phpsysinfo.sourceforge.net/ > > Good Luck! > -Joe > > On Jul 23, 2005, at 9:25 AM, André Medeiros wrote: > > > First of all, you want

Re: [PHP] Re: System specific information gathering

2005-07-23 Thread Joe Wollard
As always, look for someone else's existing project and see how they did it. ;-) http://phpsysinfo.sourceforge.net/ Good Luck! -Joe On Jul 23, 2005, at 9:25 AM, André Medeiros wrote: First of all, you want to have the two values in seperate variables. After reading the contents from the fil

Re: [PHP] Re: System specific information gathering

2005-07-23 Thread André Medeiros
First of all, you want to have the two values in seperate variables. After reading the contents from the file, do something like: -8<- function parseUptimeSeconds( $seconds ) { $resultArray = Array( 'weeks' =>

Re: [PHP] Re: System specific information gathering

2005-07-22 Thread Ramil Sagum
On 7/23/05, Vidyut Luther <[EMAIL PROTECTED]> wrote: > Ok, > If I use the file_get_contents.. how do I actually parse the > contents on /proc/uptime > cat /proc/uptime > 1400293.13 1317047.64 The first number is the total uptime in seconds, the second number is the total idle time. --

Re: [PHP] Re: System specific information gathering

2005-07-22 Thread Vidyut Luther
Ok, If I use the file_get_contents.. how do I actually parse the contents on /proc/uptime cat /proc/uptime 1400293.13 1317047.64 What do I do with those two numbers ? man uptime doesn't really talk about that file.. :/ On Jul 22, 2005, at 2:42 AM, Jasper Bryant-Greene wrote: Vidyut Luth

[PHP] Re: System specific information gathering

2005-07-21 Thread Jasper Bryant-Greene
Vidyut Luther wrote: Hello, I have a question on how to get Server side system specific information via PHP, or just general direction on how to parse some of the information found in /proc I just use file_get_contents() on the files in /proc. I would expect that would be a lot faster tha

[PHP] Re: System Call Troubles

2005-05-19 Thread Luis
maybe you should check your php safe_mode config cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: system()

2002-11-13 Thread Sebastian Konstanty Zdrojewski
Ok, I solved... It was so easy, I am trying to find the solution since yesterday. I added the apersand (&) at the end of command line. It works in background. Thanks anyway! Have a nice day! :) En3pY Sebastian Konstanty Zdrojewski wrote: Hi everybody, I am attempting to run in background a sc

Re[10]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton
Hello Darren, Something quick is like that? for($i = 0; $i < 10; $i++) { print $i."\n"; flush(); sleep(3); }; Yeah? There it is: www.xemi.info/flush.php DG> Then I'm not sure. Perhaps someone in-the-know will respond to your DG> question. Else, file a bug report. Your script runs fine on my

RE: Re[8]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread Darren Gamble
2001 3:57 PM To: Darren Gamble Cc: PHP General List Subject: Re[8]: [PHP] Re: system(), flush() and so on... Hello Darren, It's quick because of the fact that it's tracing a host near to my server. If you have noticed - ping from my server to login.icq.com that is being traced by defaul

Re[8]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton
Hello Darren, It's quick because of the fact that it's tracing a host near to my server. If you have noticed - ping from my server to login.icq.com that is being traced by default is only 10ms. Try that: www.xemi.info/test.php?host=www.google.com or something like that I waited too long...

RE: Re[6]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread Darren Gamble
l Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: faeton [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:32 PM To: Darren Gamble Cc: [EMAIL PROTECTED] Subject: Re[6]: [PHP] Re: system(), flush()

Re[6]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton
Hello Darren, You can try it yourself : www.xemi.info/test.php What do you think? Server config: RedHat 7.1, Apache 1.3.20, PHP 4.0.6 loaded as a module. PS. I tried everything. Simply everything. DG> I am not sure what the problem is, then. I presume that you installed these DG> via RPMs, an

RE: Re[4]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread Darren Gamble
ECTED]] Sent: Friday, November 30, 2001 3:01 PM To: Darren Gamble Cc: [EMAIL PROTECTED] Subject: Re[4]: [PHP] Re: system(), flush() and so on... Hello Darren, Linux RedHat 7.1, Apache 1.3.20, PHP 4.0.6 DG> Oops, you're right. I did not read that line nor was I aware of that. DG> I just tr

Re[4]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton
Hello Darren, Linux RedHat 7.1, Apache 1.3.20, PHP 4.0.6 DG> Oops, you're right. I did not read that line nor was I aware of that. DG> I just tried . It works DG> exactly as it says it should- outputs the lines as they come in. I also DG> know flush() works fine (at least for me). DG> Perhap

RE: Re[2]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread Darren Gamble
le Cc: [EMAIL PROTECTED] Subject: Re[2]: [PHP] Re: system(), flush() and so on... Hello Darren, -- manual cut The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module. -- manual cut

Re[2]: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton
Hello Darren, -- manual cut The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module. -- manual cut Hehe. The problem is not in flushing ability of system() foo, but flush() itself

RE: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread Darren Gamble
ren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: faeton [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 2:21 PM To: Julio Nobrega Trabalhando Cc: [EMAIL PROTECTED] Subject: Re: [PHP]

Re: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton
Hello Julio, Hm... I don't even know what to specify :) The exact problem is using system("traceroute host.com"), but it should've returned its results line by line, instead of executing the whole command and then outputting its result. That is done by flush(), which is executed by system() foo

[PHP] Re: system(), flush() and so on...

2001-11-30 Thread Julio Nobrega Trabalhando
Hi, please be more specific. Including what error you are getting, what is the tools being used, and their versions. Here's a quick help for producing better questions, wich will in turn make us answer faster and with more quality: http://www.tuxedo.org/~esr/faqs/smart-questions.html PS:

[PHP] Re: system() vs exec()

2001-09-05 Thread Richard Lynch
> The system() call will flush the headers to the client while exec() won't, Yes. > but exec() won't wait until the system call is over. Huh? Exec waits unless the call itself forks using & to do something in the background. > Is there a way to make a system call, and wait until it ends, but