To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Linux/Unix Help

Linux/Unix Help Help with server-side Linux and Unix issues

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-08-2002, 09:26 AM   #1
jaemark
Junior Member
 
Join Date: Sep 2002
Posts: 2
Question Program Execution Problems

I'm having trouble with executing external programs from my PHP scripts when called from the browser. I've tried using system(), exec(), shell_exec(), and backticks.

I'm beginning to suspect that this has something to do with the mod_php module, because when I run the scripts from the command line using the PHP interpreter, they execute correctly. Problems come up when I run the same scripts from the browser.

Also, running simple commands such as "ls -l" work from the browser, but more complex applications (like, say, fortune or kwrite) don't. These same scripts work with the PHP interpreter.

I was wondering if this is an issue with the module, because the programs I run don't need to access data files so I don't think this is an ownership/access problem.

Thanks in advance for the help.
jaemark is offline   Reply With Quote
Old 09-10-2002, 06:43 PM   #2
tasistro
Saurondor
 
tasistro's Avatar
 
Join Date: Nov 2001
Location: Mexico
Posts: 297
Ive uses backtics to do what you want

$command="lynx %whatever url here%";
$output=`$command`;

I works fine with complex TEXT only programs.

As for kwriter and the sort I think you need to have permision to access an Xsever which apache probably does not. I'm guessing this because apache doesn't even have an account directory so there is no way to save settings on $HOME. The reason it works when you run them from the interpreter is that the interpreter is running with you permissions and so is the script.

Saludos
Gerardo
tasistro is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:55 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.