Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

include command and php.ini problems

include, php.ini

3:54 pm on May 31, 2012 (gmt 0)

New User

joined:May 31, 2012
posts: 2
votes: 0

We have a managed dedicated server that has just been updated to Apace2 and PHP 5.2.17. (Originally PHP 4.4.9 which is still there).

We use the include command on our .php pages and also have a line in .htaccess file to run the include command in our .htm pages. Everything was working fine until the upgrade.

In the .htaccess file we have ben told to use the following line AddHandler x-mapp-php5 .htm

Everything is working okay but for the inclusion of RSS feeds that we obtain from licenced 3rd party websites. These inclusions work okay on .php pages but not on the .htm pages.

This is the error message we get :

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /homepages/46/d69851822/htdocs/#*$!x.com/index.htm on line 29

Warning: include(http://www.#*$!x.com/rssbuild/rss2html.php?XMLFILE=http://feeds.#*$!.co.uk/news/rss.xml&TEMPLATE=http://www.#*$!xo.com/rssbuild/template.html&MAXITEMS=10) [function.include]: failed to open stream: no suitable wrapper could be found in /homepages/46/d69851822/htdocs/#*$!x.com/index.htm on line 29

Warning: include() [function.include]: Failed opening 'http://www.#*$!x.com/rssbuild/rss2html.php?XMLFILE=http://feeds.#*$!x.co.uk/news/rss.xml&TEMPLATE=http://www.#*$!xx.com/rssbuild/template.html&MAXITEMS=10' for inclusion (include_path='.:/usr/lib/php5') in /homepages/46/d69851822/htdocs/#*$!xx.com/index.htm on line 29

I have been told to put a php.ini file in the directory with just the following lines of text to override the main php.ini file:

register_globals = On

allow_url_fopen = On

allow_url_include = On

But this has no effect.

Any ideas?

Many thanks
6:15 pm on May 31, 2012 (gmt 0)

Full Member

5+ Year Member

joined:Mar 22, 2011
votes: 0

was added in PHP 5.2 and defaults to off, which is probably why your
s fail after the upgrade.

If you regularly use URLs in your
s, you might want to consider turning
on in PHP's main configuration file. If you only use for a few of your projects or don't have access to the configuration file, you can turn it on per-directory using an
file. That file should include the following line:

php_flag allow_url_include on

Edit: Missed this part...

These inclusions work okay on .php pages but not on the .htm pages.

That's a little weird. There might be something else to this, but try the above first.

Edit #2: Actually, if possible, create a
file and a
file. Put a call to

<?php phpinfo(); ?>

...in both and see if there are any differences. This might give you a clue.

7:33 pm on May 31, 2012 (gmt 0)

New User

joined:May 31, 2012
posts: 2
votes: 0


Many thanks for the quick reply.

I put
php_flag allow_url_include on
in the .htaccess file and it returned an Internal Server Error.

I removed that and then put
<?php phpinfo(); ?>
onto two pages, one .htm and the other .php

It would appear that because of the line in the .htaccess file AddHandler x-mapp-php5 .htm
the .htm is using php 5.2.17 and is not working correctly i.e giving the error mesages as I indicated.
whereas the .php file is using PHP 4.4.9 and is working correctly.

Iam unable to change the php.ini file but the service provider said to use a local php.ini file in the directory of the .htm pages, but of course this dosen't work.

I therefore thought that if I put

AddType application/x-httpd-php .html .htm

it just tries to download a file!

Oh happy days!

8:31 pm on May 31, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

in place of or in addition to

register_globals = On
is probably a bad idea.
11:31 pm on June 1, 2012 (gmt 0)


WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
votes: 1


This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.