can't include() remote website in php / phtml files

SilverNodashi

Expert Member
Joined
Oct 12, 2007
Messages
3,340
Reaction score
48
Location
Johannesburg, South Africa
Hi all

i have (had) a simple index.phtml script, which I put in "/root/cpanel3-skel/public_html/" that included a welcome page on my server, which I could change as I liked. This worked fine for a long time, but now it doesn't seem to work anymore.

Here's the script:
PHP:
[root@gandalf www]# more /root/cpanel3-skel/public_html/index.phtml
<center><h2>The Domain <? echo $_SERVER['HTTP_HOST']; ?> has been registered by <a href="http://www.SoftDux.com" target="_blank">SoftDux</a></h2></center><B
R><BR>
<?
include_once("http://park.mydomain.com");
?>

The problem is, it doesn't include the http://park.mydomain.com domain anymore.

If I add the following lines to it, I get the desired output though:
PHP:
<?
echo "test foo";
?>

I'm running Apache 2.0.61 & PHP 5.2.4
[root@gandalf www]# httpd -v; php -v
Server version: Apache/2.0.61
Server built: Sep 25 2007 17:59:50
Cpanel::Easy::Apache v3.2.0 rev2434
PHP 5.2.4 (cli) (built: Sep 25 2007 18:11:47)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Suhosin v0.9.20, Copyright (c) 2002-2006, by Hardened-PHP Project
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies

Any suggestions?
 
Short open PHP tags are disabled by default on PHP 5.2.4
Change the code to <?php ... ?>

Check the following settings in your PHP.ini file:
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = On

Put the following file ("info.php") in the root to check for your current PHP.ini settings:
<?php
phpinfo();
?>
 
I have got short_open_tag = On, allow_url_fopen = On, allow_url_include = On

Yet it still doesn't work.

If you take a look at http://bearsandthings.co.za/ you'll see the site that I'm referring to. This site needs to include the code from http://park.softdux.com, but it doesn't.

PHP code from index.phtml in bearsandthings.co.za's root folder:
PHP:
[root@gandalf ~]# cat /home/bearscom/www/index.phtml
<center><h2>The Domain <? echo  SERVER['HTTP_HOST']; ?> has been registered by <a href="http://www.SoftDux.com" target="_blank">SoftDux</a></h2></center><BR><BR>
<?
include_once("http://park.softdux.com");
?>
[root@gandalf ~]#
 
try including the full URL, including the "filename":

include_once("http://park.softdux.com/index.html")

instead of

include_once("http://park.softdux.com")

change index.html as needed.
 
Top
Sign up to the MyBroadband newsletter
X