Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2002
    Location
    Hilton Head SC
    Posts
    4

    * New PHP Guy needs help

    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.

  2. #2
    Join Date
    Nov 2001
    Posts
    857
    What is the path from root to common.php on your new host?
    <?
    header("Location: http://www.hostevolve.com/");
    ?>

  3. #3
    Join Date
    Jul 2001
    Location
    Wrapped in CAT5.
    Posts
    217

    Re: New PHP Guy needs help

    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...on.php#AEN2398 for an example.

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

    Dan
    Dan Esparza
    CagedTornado web services

  4. #4
    Join Date
    Jan 2001
    Posts
    552

    Re: New PHP Guy needs help

    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.

  5. #5
    Join Date
    Aug 2002
    Location
    Hilton Head SC
    Posts
    4

    Thanks, I'll get it one day

    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?

  6. #6
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    Different servers have different configs. Just because your old host had that directory structure by no means guarantees that anyone else will.

  7. #7
    Join Date
    Aug 2002
    Location
    Hilton Head SC
    Posts
    4

    Different Configs

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •