Page 1 of 1

PHP include

Posted: Fri Apr 28, 2006 1:27 pm
by btpwebdev
Hi,
I had a website on Streamlinenet and now have moved to a new host using a VPS.
after copying all of files accross via ftp, the files that use the include command dont seem to be working. When i do a php include the file that was meant to be included just gets ignored.

Posted: Fri Apr 28, 2006 2:29 pm
by aeav
try to see the php.ini config, the variable GLOBALS have to be turned ON.
I think that it's the problem, or the variable already´s ON?

Posted: Fri Apr 28, 2006 3:00 pm
by btpwebdev
Hi,
I am having a slight problem finding the php.ini file at the moment, I am using Plesk which is new for me so it may take a bit of time to get there.

I have noticed that i can include a document that isnt hosted on this server (eg include'google.com...) but none from this server.

Posted: Fri Apr 28, 2006 3:55 pm
by aeav
well, I don't know about include files of another server I think that's impossible, but you can find the php.ini with the shell, try to type this command in the shell:
find / -name php.ini
or
updatedb
locate php.ini

With you're using a VPS with Windows, I don't know how to find the file with ms-dos.. :(

Posted: Fri Apr 28, 2006 4:29 pm
by RobertGonzalez
How are you calling include and are you sure that all of your included files are there? Also, check your paths to the included files to make sure they resolve correctly. And lastly, is your new server the same set up as your old server?

Posted: Fri Apr 28, 2006 4:39 pm
by timvw
php has a include_path setting... Probably it's different on your localhost and the one of your provider...

Code: Select all

<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);

require('myfile.php');

echo 'your include_path setting is: ' . ini_get('include_path');

?>

Posted: Fri Apr 28, 2006 4:44 pm
by aeav
good observation I forgot it...

Same servers work a path like this:

include("other_file.php");

And some servers just work like this:

include("./other_file.php");

Is a stupid example, but it's true

Posted: Mon May 01, 2006 12:45 pm
by btpwebdev
Hi,
Thanks,
it worked, i had to change everything from
include("http://www.bigtreeproject.com/directory/header.php")
to
include("./directory/header.php");
It is quite annoying as ill have to change it in every file, but thanks every1!!

Chris.