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 10-17-2002, 07:26 AM   #1
vicus
Junior Member
 
Join Date: Oct 2002
Location: Johannesburg, Gauteng, South Africa
Posts: 1
Exclamation php shell script issue

I'm executing a php shell script from within a php webpage using exec().. I am sending this php shell script some arguments that I access using the array $argv ($argv[0],$argv[1],etc). The shell script has:

#!/usr/bin/php -q

at the top. Now as far as I know, the -q is to suppress HTTP headers, but it returns this output (when the php webpage executes it):

X-Powered-By: PHP/4.2.1
Content-type: text/html

No input file specified.

Note that the headers are still there. When I remove the -q it returns this:

X-Powered-By: PHP/4.2.1
Content-type: text/html

Warning: Division by zero in /path/to/shell/script/file on line 63

This is because NOW it's not getting the $argv vars (Still executed by the php webpage)...BUT... when I make the php webpage echo the command and all it's arguments (that I pass to the exec() function), copy it out and paste/execute it in the shell, the php shell script executes fine, with the -q (surpressing headers) or without the -q (showing headers)... no errors.. picking up ALL the arguments sent??

The webpage executes the shell script, but its like the arguments don't get sent without the -q, and with it, it just says: "No input file specified"... and executed from within a shell, all works fine??

what to do, what to do
vicus 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 03:42 PM.






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.