You are hereBlogs / wes's blog / PHP Include function

PHP Include function


By wes - Posted on 14 July 2008

I'm building a web front end for a postfix server that will allow specific users to add an IP address to the allowed relay list. The problem I ran into is that I'm running the VERY lightweight page on the actual server itself and I wanted to wrap the Intranet site that the company is familiar with around my little contribution to the tech support effort.

I knew that the include and/or require function would go and "get" the file for me but I couldnt make it work. I read many forums answers to this and the answer was always turn on allow_url_fopen. It was on by default, so I scrolled down an viola found a directive to allow_url_include, it was turned off. Turned it on, restated apache and success.

So, now my php statement fopen(https://sitename/path/to/file","r"); works!

Just in case someone else stumbles upon this, hope I was helpful.

I have not idea of the security repercussions so proceed at your own risks. I'm still in dev so I have an excuse.

Navigation

Worth Repeating...

Freedom is never more than one generation away from extinction. We didn't pass it to our children in the bloodstream. It must be fought for, protected, and handed on for them to do the same.

— Ronald Reagan

Firefox 3

Delicious Tag