> I've read through the archives and still must be missing something. I
> need to execute a cgi script from php. This seems fairly trivial, but I
> can't get it to work.
>
> the cgi script is clean -- executes from the command line without issue
> and is 755
> from php the follwing is used:
>
>
> chdir("../../cgibin");
> if(is_executable("some.cgi"))
>     virtual("some.cgi");
> else
>     echo "Not executable";
>
> some.cgi is found and is executable but the following occurs when
> attemping to execute via virtual():
>
> Warning: Unable to include 'some.cgi' - request execution failed in
> [path to php page]

1. Are you running PHP as a Module?  If not, and PHP is itself running as a
CGI, virtual() simply cannot be used.  Solution: Use exec() (or system()
or...)

2. Path issues:  Try providing the full path to your CGI from the machine's
root file-system and/or from DOCUMENT_ROOT.  I'm not sure if virtual() uses
the include path, the current directory, or what, but you can never go wrong
with an absolute full pathname.  Well, until you try to move from one server
to another.  But you can get it to work for now, and then try variations on
altering include_path and suchlike later.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]

Reply via email to