Re: php5 include() problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tijnema ! wrote:
On 5/13/07, Al <news@xxxxxxxxxxxxx> wrote:
I've got a cgi file in my cgi-bin folder that I'm calling with include(). It worked with php4.

My shared host just upgraded to my server to php5.2.0 and the function doesn't work. I can't tell if the problem is a php5 or server configuration [which may have changed during the upgrade] issue.

If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755

file.cgi chmods the designated directory's permissions. It's a cgi with a php shebang #!/usr/bin/php

A simple file_exists() shows the file exists OK, TRUE.

I've tried using both syntaxes.

include("/home/foo/public_html/cgi-bin/file.cgi?dir=test&perms=0755");

include("www.foo.org/cgi-bin/file.cgi?dir=test&perms=0755");

Here is the error msg:
> Warning: include(/home/foo/public_html/cgi-bin/file.cgi?dir=/test&perms=0755) [function.include]: failed to open stream: No such file or directory in /home/foo/public_html/EditPage/cgi_file_test.php
on line 15

Bottom line: It appears include() is not working right, for whatever reason.

Anyone have any ideas?

Thanks, Al........


What the heck are you trying to do?
You want the cgi file to be executed? Or is there PHP code in the cgi file?
If you want the first, you should look at exec() or system() or such.
If there's PHP code, there's no sense in passing variables to the CGI
script, and if you remove the variables it will work.

Tijnema

See the examples on this page:  http://ca.php.net/include/
What you probably want to do is to change the cgi script to php and then give the full url, incuding http.

--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux