For sometime, I have noticed I get errors on pages with included scripts like the error message below shows:

   * warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/xprt007/public_html/drupal5/includes/common.inc(1342) : eval()'d code on line 2.
    * warning: include(mysite/drupal5/diverse/smstool.html) [function.include]: failed to open stream: no suitable wrapper could be found in /home/xprt007/public_html/drupal5/includes/common.inc(1342) : eval()'d code on line 2.
    * warning: include() [function.include]: Failed opening 'mysite/drupal5/diverse/smstool.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xprt007/public_html/drupal5/includes/common.inc(1342) : eval()'d code on line 2.
    * warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/xprt007/public_html/drupal5/includes/common.inc(1342) : eval()'d code on line 2.
    * warning: include(mysite/drupal5/diverse/smstool.html) [function.include]: failed to open stream: no suitable wrapper could be found in /home/xprt007/public_html/drupal5/includes/common.inc(1342) : eval()'d code on line 2.
    * warning: include() [function.include]: Failed opening 'mysite/drupal5/diverse/smstool.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xprt007/public_html/drupal5/includes/common.inc(1342) : eval()'d code on line 2.

I dont remember changing anything and all the included scripts

<?
include "mysite/drupal5/diverse/smstool.html";
?>
 

where working before.
The scripts, whether Javascript or other like the one above, work with no problem if I go to the page directly.
Because of this I have had to disable them to avoid the very conspicuous error messages.

What could be wrong?

Thanks in advance.

Comments

StevenPatz’s picture

pobster’s picture

Did you perhaps upgrade your php lately? Check that your php.ini looks like this;

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

If not, it's either folder or file permissions...

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

lionheart8’s picture

Thanks for responding...

I contacted the host after reading your posts and they confirmed that function has been deliberately disabled for security reasons (this is a small private free host).

After thinking about

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

... I decided to gamble & get rid of "http://", since I was using the whole url, so that only the relative paths remained. All affected scripts worked with no problem.

Thanks & regards

lionheart8’s picture

Thanks for responding...

I contacted the host after reading your posts and they confirmed that function has been deliberately disabled for security reasons (this is a small private free host).

After thinking about

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

... I decided to gamble & get rid of "http://", since I was using the whole url, so that only the relative paths remained. All affected scripts worked with no problem.

Thanks & regards

lionheart8’s picture

Thanks for responding...

I contacted the host after reading your posts and they confirmed that function has been deliberately disabled for security reasons (this is a small private free host).

After thinking about

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

... I decided to gamble & get rid of "http://", since I was using the whole url, so that only the relative paths remained. All affected scripts worked with no problem.

Thanks & regards

hadishon’s picture

After upgrading to PHP5, I had a similar problem. My php.ini file did state allow_url_fopen = On

But I still couldn't include a http as a file.

After much research I found the solution here:
http://www.forum.psoft.net/archive/index.php/t-19173.html

In short you also need to include this line in PHP5's php.ini file:

allow_url_include = 1

OR this in your .htaccess file:

php_flag allow_url_include 1

I'm including this here in case anyone else has the same problems I did and this may make it easier for them to find a solution.