include_path and doc_root

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    #1

    include_path and doc_root

    Dear all,

    I have a website hosted on Apache, where phpinfo gives DOCUMENT_ROOT as
    /home/mysite/public_html, and include_path as
    ..:/usr/lib/php:/usr/local/lib/php; I have no control over these. For
    development, work, however, I use IIS, but here I do have access to php.ini
    file.

    Basically I'm after a way to tweak (fudge) my local configuration such that
    I can use include("/home/mysite/public_html/includes/public.php"); (for
    instance), as well as <link rel="stylesheet " type="text/css"
    href="/stylesheets/public.css" /> (for instance) on my development
    workstation as well as on the live server.

    I'm using IIS 5.1 on Windows XP, where my default web site's home directory
    points to D:\My Documents\My Website\home\my site\public_htm l; my first
    instinct was to set my local doc_root to D:\My Documents\My Website (and
    every imagineable combination of trailing slashes/forwardslashes/quotes) in
    php.ini, but doing so results in IIS returning a 404 error whenever it tries
    to process a PHP page, presumably because it's outside this root directory
    of IIS's default web site.

    Any ideas? I don't particulalry want to install Apache locally (most of the
    time I'm developing in ASP.NET), or use set_include_pat h(); every time I use
    an include function...

    Thanks in advance,

    Paul
    Relative newbie


  • NSpam

    #2
    Re: include_path and doc_root

    Paul wrote:[color=blue]
    > Dear all,
    >
    > I have a website hosted on Apache, where phpinfo gives DOCUMENT_ROOT as
    > /home/mysite/public_html, and include_path as
    > .:/usr/lib/php:/usr/local/lib/php; I have no control over these. For
    > development, work, however, I use IIS, but here I do have access to php.ini
    > file.
    >
    > Basically I'm after a way to tweak (fudge) my local configuration such that
    > I can use include("/home/mysite/public_html/includes/public.php"); (for
    > instance), as well as <link rel="stylesheet " type="text/css"
    > href="/stylesheets/public.css" /> (for instance) on my development
    > workstation as well as on the live server.
    >
    > I'm using IIS 5.1 on Windows XP, where my default web site's home directory
    > points to D:\My Documents\My Website\home\my site\public_htm l; my first
    > instinct was to set my local doc_root to D:\My Documents\My Website (and
    > every imagineable combination of trailing slashes/forwardslashes/quotes) in
    > php.ini, but doing so results in IIS returning a 404 error whenever it tries
    > to process a PHP page, presumably because it's outside this root directory
    > of IIS's default web site.
    >
    > Any ideas? I don't particulalry want to install Apache locally (most of the
    > time I'm developing in ASP.NET), or use set_include_pat h(); every time I use
    > an include function...
    >
    > Thanks in advance,
    >
    > Paul
    > Relative newbie
    >
    >[/color]
    Use relative paths

    Comment

    • NSpam

      #3
      Re: include_path and doc_root

      Paul wrote:[color=blue]
      > Dear all,
      >
      > I have a website hosted on Apache, where phpinfo gives DOCUMENT_ROOT as
      > /home/mysite/public_html, and include_path as
      > .:/usr/lib/php:/usr/local/lib/php; I have no control over these. For
      > development, work, however, I use IIS, but here I do have access to php.ini
      > file.
      >
      > Basically I'm after a way to tweak (fudge) my local configuration such that
      > I can use include("/home/mysite/public_html/includes/public.php"); (for
      > instance), as well as <link rel="stylesheet " type="text/css"
      > href="/stylesheets/public.css" /> (for instance) on my development
      > workstation as well as on the live server.
      >
      > I'm using IIS 5.1 on Windows XP, where my default web site's home directory
      > points to D:\My Documents\My Website\home\my site\public_htm l; my first
      > instinct was to set my local doc_root to D:\My Documents\My Website (and
      > every imagineable combination of trailing slashes/forwardslashes/quotes) in
      > php.ini, but doing so results in IIS returning a 404 error whenever it tries
      > to process a PHP page, presumably because it's outside this root directory
      > of IIS's default web site.
      >
      > Any ideas? I don't particulalry want to install Apache locally (most of the
      > time I'm developing in ASP.NET), or use set_include_pat h(); every time I use
      > an include function...
      >
      > Thanks in advance,
      >
      > Paul
      > Relative newbie
      >
      >[/color]
      who said linux is stable - thunderbird just wen down with a seg fault,
      use relative paths based on the webroot directory

      Comment

      • Michael Fesser

        #4
        Re: include_path and doc_root

        .oO(NSpam)
        [color=blue]
        >who said linux is stable - thunderbird just wen down with a seg fault,[/color]

        Linux is just the kernel, nothing more.

        Micha

        Comment

        Working...