SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php and apache file issues

    I am running php on apache. I have setup multiple virtual-hosts on apache and managed to get php scripts working on a test website, but I am having trouble getting apache files to run on all my virtual hosts.

    In my php.ini file at the bottom I have added
    doc_root = "c:\test"
    extension_dir = "C:\php\ext"
    extension=php_mysqli.dll.

    So when I go to http://lc.test.com/, it successfully runs my php test script in the browser.
    However... when I go to my other virtualhost site http://lc.informativesolutions.com/, it actually runs the same script from c:\test, when my index.php file in the informativesolutions directory is a completley different file. Is that normal?

    Anyway I want to set up php for all my sites so do I add doc_root and extension dir per virtual host like this:
    doc_root = "c:\test"
    extension_dir = "C:\php\ext"
    extension=php_mysqli.dll.

    doc_root = "c:\apple"
    extension_dir = "C:\php\ext"
    extension=php_mysqli.dll.

    doc_root = "c:\tango"
    extension_dir = "C:\php\ext"
    extension=php_mysqli.dll.

    Or do I need to specifiy the name of the virtualhost along with it? Or put php access to virtual hosts somewhere else?

  2. #2
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also in my apache's httpd.conf file I have:
    DocumentRoot "C:/test"
    <Directory "C:/test">

    and Include conf\virtual-hosts.conf where I have setup my virtual hosts.

    I am not sure if the docroot and dir entries in the httpd conf is why it isnt working, same as in the php file I am not sure if I should add more entries for each host or if there should only be one.

  3. #3
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also forgot to add that when viewing normal html files, each virtualhost site displays the correct files for that individual website so I am positive that my virtualhosts directory setup is correct and different for each virtualhost. It is only when viewing php file that it seems to leap from my virtualhost to the test directory.

  4. #4
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed it simply by removing doc_root = "c:\test" from my php.ini file. I was told to add that during php setup, not sure why becuase php seems to work a whole lot better without it.


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
  •