SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation localhost development of multiple sites trouble!

    I have setup on my machine, PHP, mySQL, and Apache.

    I have set my document root with apache to my e: drive's root directory with the intention of being able to develop/test multiple sites at a time simply by accessing each site by typing ht tp://localhost/sitename/testpage (intentional space in http).

    However! I have discovered that since I began development of a second site, I can not get the script to access the includes that I have trying to "include" in the script.

    The directory structure for each site is like this:
    e:/siteOne/includes
    e:/siteTwo/includes

    I have even created an .htaccess file for each site, but to no avail. The includes of the second site REFUSE to be included, even when I commented out the "include_path" setting in the php.ini file and restarted apache.

    I'm at a loss at what to do, or what to change, and any help would be greatly appreciated!
    John

  2. #2
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How exactly are you calling the includes?

    You could always try setting your own include path constant and using that for your includes, eg:
    PHP Code:
    define('INC_DIR''e:/siteOne/includes/');
    require_once(
    INC_DIR.'includeFile.inc.php'); 
    I never use the include_path directive, so I don't know what impact that could be having. Also remove any @ symbols you have infront of your include statement, as if the files are not being included, and you're not getting an error describing why, something must be surpressing them. Also check the error reporting level that your script is running under.
    Oh no! the coots are eating my nodes!

  3. #3
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's fine, but at the top of all of my scripts I have an include that comes before the definition and so it requires the full path for that include. So when I make the site public, I still have to change the path at least once on ALL of the scripts for that site that have includes. While this does reduce the amount of adjustments that I would have to make, I was hoping there would be an easier way.

    I can't believe that you and I are the only ones that write multiple sites at once, locally.

    My error reporting is up so high that it even tells me when I have an undefined variable! And for development, I never put @ in front of any function. (I save that for when a site goes public)
    John

  4. #4
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something really weird must be going on then if the files aren't being included and there are no errors being spat out.
    Oh no! the coots are eating my nodes!


Bookmarks

Posting Permissions

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