Web Hosting Talk







View Full Version : New PHP Guy needs help


CSTSUPERMAN
08-23-2002, 10:58 AM
I just tryed to move our website to a new host, and am getting lots of errors. I have never worked with PHP, obviously.

Our site has a common.php file with a "require()" statement. I am not sure what path I need to put in there? It currently reads as such:

require("/home/httpd/EPA/_config/common.php");

There isn't a "/_config/" folder on the old server that I can see using FTP. My current host said to create the "_config" folder and it should work.

This works on our old host running PHP 4.0.6, but not our new webhost running PHP 4.2.1
I also have the same error messages when previewing it locally running php 4.2.2

This is coded in other files:

require("./common.php");
require("$path_header");

I am assuming the "common.php" file is the source of the problem.

I also tried to add an "include_path=" to the common.php file, but get an "unexpected = encountered" error.

Please any help would be greatly appreciated.

michaeln
08-23-2002, 01:24 PM
What is the path from root to common.php on your new host?

CagedTornado
08-24-2002, 12:01 PM
Originally posted by CSTSUPERMAN
I just tryed to move our website to a new host, and am getting lots of errors. I have never worked with PHP, obviously.

Our site has a common.php file with a "require()" statement. I am not sure what path I need to put in there? It currently reads as such:

require("/home/httpd/EPA/_config/common.php");

There isn't a "/_config/" folder on the old server that I can see using FTP. My current host said to create the "_config" folder and it should work.

This works on our old host running PHP 4.0.6, but not our new webhost running PHP 4.2.1
I also have the same error messages when previewing it locally running php 4.2.2

This is coded in other files:

require("./common.php");
require("$path_header");

I am assuming the "common.php" file is the source of the problem.

I also tried to add an "include_path=" to the common.php file, but get an "unexpected = encountered" error.

Please any help would be greatly appreciated.

Some issues you might encounter:

include_path belongs in either an Apache configuration file (yes, you can actually put stuff like this there) or more likely in the php.ini file. See http://www.php.net/manual/en/printwn/configuration.php#AEN2398 for an example.

See http://www.php.net/manual/en/function.require.php for documentation on the 'require' function.

Dan

brookie
08-24-2002, 03:12 PM
Originally posted by CSTSUPERMAN
I just tryed to move our website to a new host, and am getting lots of errors. I have never worked with PHP, obviously.

Our site has a common.php file with a "require()" statement. I am not sure what path I need to put in there? It currently reads as such:

require("/home/httpd/EPA/_config/common.php");

There isn't a "/_config/" folder on the old server that I can see using FTP. My current host said to create the "_config" folder and it should work.

This works on our old host running PHP 4.0.6, but not our new webhost running PHP 4.2.1
I also have the same error messages when previewing it locally running php 4.2.2

This is coded in other files:

require("./common.php");
require("$path_header");

I am assuming the "common.php" file is the source of the problem.

I also tried to add an "include_path=" to the common.php file, but get an "unexpected = encountered" error.

Please any help would be greatly appreciated.
You could try putting the common.php file in the same directory as the code which requires it (although not a good idea if it contains passwords for MySQL etc.).

Do you have shell access (SSH) to your new host? If so, log on and do a pwd (print working directory) command to see where you are.

What "control panel" is your new host running? CPanel, Plesk, Ensim? That will give us a clue as to the path you publish your web pages to.

CSTSUPERMAN
08-29-2002, 01:06 PM
I havent figured the problem, but thanks for your help so far. I have read most everything I possibly could at www.php.net


The common.php file as is, which ran perfectly on the old Host started as such:

"require("/home/httpd/pinckneyassociates/_config/common.php");"


I have run phpinfo.php on both webhosts and noticed this variable.

Old Host:
DOCUMENT_ROOT /home/httpd/pinckneyassociates/www/

New Host:
DOCUMENT_ROOT /home/pinckne/public_html

There is no slash at the end of "....public_html" Could this be the problem?

Rich2k
08-30-2002, 04:33 AM
Different servers have different configs. Just because your old host had that directory structure by no means guarantees that anyone else will.

CSTSUPERMAN
08-30-2002, 02:25 PM
Thanks Rich,
I had figured all hosts had different paths, but did not really know it would affect the site. I assumed the root folder would act the same on each.

I'll keep trying to get it going.
Thanks again