include_path related issue

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

    include_path related issue

    I suspect the following problem IS hosting provider specific, but they
    haven't been able to help me out so far. Perhaps I am doing something
    wrong and someone is able to spot the issue... Here goes.

    The actual path of the root dir of my account with hosting provider
    (H.P.) is:
    /usr/local/psa/home/vhosts/mydomain.com/
    The webroot is a subdir of the root:
    /usr/local/psa/home/vhosts/mydomain.com/httpdocs.
    Include files go in:
    /usr/local/psa/home/vhosts/mydomain.com/includes.
    ..htaccess in httpdocs contains:
    php_value include_path ".|../includes"

    I can specify additional subdomains in the control panel of my account.
    They automatically go in
    /usr/local/psa/home/vhosts/mydomain.com/subdomains/
    One of these:
    /usr/local/psa/home/vhosts/mydomain.com/subdomains/customer
    which also has the subdirs 'httpdocs' and 'includes'
    To browse httpdocs/index.php the subdomain the URL reads:
    http://customer.mydomain.com[/index.php]
    The .htaccess file in httpdocs is similar to the one in my master domain.
    PHP recognizes the include_path setting properly, yet fails to open ANY
    file in the includes directory (e.g.):
    Fatal error: main() [function.requir e]: Failed opening required
    'dbconn.inc' (include_path=' .:../includes') in
    /usr/local/psa/home/vhosts/mydomain.com/subdomains/customer/httpdocs/counter.php
    on line 4

    Permissions are set along the same lines for both master and
    sub-domains, 'r-x' to others for all subdirs involved, 'r--' for the files.

    Any ideas what prevents PHP from opening include files for my
    subdomains? Open_basedir is set to my root dir btw by H.P., if that
    makes any difference for this issue.

    Hope my message is readable enough. Thanks in advance!
    Sh.
  • Rik

    #2
    Re: include_path related issue

    Schraalhans Keukenmeester wrote:
    php_value include_path ".|../includes"
    (include_path=' .:../includes')
    If a unix box, the colon seems correct (windows would have a semicolon).
    I've never seen a pipe use for this though, but that might be my lack
    of OS knowledge and environmental variables.

    --
    Rik Wasmus

    Comment

    • Schraalhans Keukenmeester

      #3
      Re: include_path related issue

      Rik wrote:
      Schraalhans Keukenmeester wrote:
      > php_value include_path ".|../includes"
      >
      >
      >(include_path= '.:../includes')
      >
      If a unix box, the colon seems correct (windows would have a semicolon).
      I've never seen a pipe use for this though, but that might be my lack
      of OS knowledge and environmental variables.
      >
      The pipe was a typo, alas. If only it were so easy, Rik.Thanks for your
      keen eye though! No news from my provider either. WEIRD!

      Sh.

      Comment

      • Rik

        #4
        Re: include_path related issue

        Schraalhans Keukenmeester wrote:
        Rik wrote:
        >Schraalhans Keukenmeester wrote:
        >> php_value include_path ".|../includes"
        >>
        >>(include_path ='.:../includes')
        >If a unix box, the colon seems correct (windows would have a semicolon).
        > I've never seen a pipe use for this though, but that might be my lack
        >of OS knowledge and environmental variables.
        >>
        The pipe was a typo, alas. If only it were so easy, Rik.
        Wish it was...
        Thanks for your
        keen eye though! No news from my provider either. WEIRD!
        What happens if you try to include it specifically? Does that work or
        does that give a more clear error?
        --
        Rik Wasmus

        Estimated date being able to walk again: 01-05-2007.
        Less then a week, hurray!

        Comment

        • shimmyshack

          #5
          Re: include_path related issue

          On Apr 24, 4:34 pm, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
          wrote:
          I suspect the following problem IS hosting provider specific, but they
          haven't been able to help me out so far. Perhaps I am doing something
          wrong and someone is able to spot the issue... Here goes.
          >
          The actual path of the root dir of my account with hosting provider
          (H.P.) is:
          /usr/local/psa/home/vhosts/mydomain.com/
          The webroot is a subdir of the root:
          /usr/local/psa/home/vhosts/mydomain.com/httpdocs.
          Include files go in:
          /usr/local/psa/home/vhosts/mydomain.com/includes.
          .htaccess in httpdocs contains:
          php_value include_path ".|../includes"
          >
          I can specify additional subdomains in the control panel of my account.
          They automatically go in
          /usr/local/psa/home/vhosts/mydomain.com/subdomains/
          One of these:
          /usr/local/psa/home/vhosts/mydomain.com/subdomains/customer
          which also has the subdirs 'httpdocs' and 'includes'
          To browse httpdocs/index.php the subdomain the URL reads:
          http://customer.mydomain.com[/index.php]
          The .htaccess file in httpdocs is similar to the one in my master domain.
          PHP recognizes the include_path setting properly, yet fails to open ANY
          file in the includes directory (e.g.):
          Fatal error: main() [function.requir e]: Failed opening required
          'dbconn.inc' (include_path=' .:../includes') in
          /usr/local/psa/home/vhosts/mydomain.com/subdomains/customer/httpdocs/counter.php
          on line 4
          >
          Permissions are set along the same lines for both master and
          sub-domains, 'r-x' to others for all subdirs involved, 'r--' for the files.
          >
          Any ideas what prevents PHP from opening include files for my
          subdomains? Open_basedir is set to my root dir btw by H.P., if that
          makes any difference for this issue.
          >
          Hope my message is readable enough. Thanks in advance!
          Sh.
          the short answer is not to reply on the includes directive/.htaccess
          files, just define the application include root (and any and all other
          paths your application needs) for yourself in your php application and
          then prefix any attempt to open an include with that definition. Your
          application becomes more portable as it doesnt reply on the ability to
          set the includes dir in an .htaccess file. that's what i would do
          anyway!

          Comment

          • Schraalhans Keukenmeester

            #6
            Re: include_path related issue

            Rik wrote:
            Schraalhans Keukenmeester wrote:
            >Rik wrote:
            >>Schraalhans Keukenmeester wrote:
            >>> php_value include_path ".|../includes"
            >>>
            >>>(include_pat h='.:../includes')
            >>If a unix box, the colon seems correct (windows would have a semicolon).
            >> I've never seen a pipe use for this though, but that might be my lack
            >>of OS knowledge and environmental variables.
            >>>
            >The pipe was a typo, alas. If only it were so easy, Rik.
            >
            Wish it was...
            >
            >Thanks for your
            >keen eye though! No news from my provider either. WEIRD!
            >
            What happens if you try to include it specifically? Does that work or
            does that give a more clear error?
            No matter what I try, just the filename, or including the relative or
            even full path to the include file, same error, no further specification
            of why this happens.

            (Helpdesk people can be really annoying, you tell them you have a
            working solution with include files outside httpdocs which you'd like to
            work for subdomains as well. The reply after two working days: "You
            can't include files outside your httpdocs on the server, that's why it's
            not working." Sigh!!! Guns please!)

            Comment

            • Schraalhans Keukenmeester

              #7
              Re: include_path related issue

              shimmyshack wrote:
              On Apr 24, 4:34 pm, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
              wrote:
              >I suspect the following problem IS hosting provider specific, but they
              >haven't been able to help me out so far. Perhaps I am doing something
              >wrong and someone is able to spot the issue... Here goes.
              >>
              >The actual path of the root dir of my account with hosting provider
              >(H.P.) is:
              > /usr/local/psa/home/vhosts/mydomain.com/
              >The webroot is a subdir of the root:
              > /usr/local/psa/home/vhosts/mydomain.com/httpdocs.
              >Include files go in:
              > /usr/local/psa/home/vhosts/mydomain.com/includes.
              >.htaccess in httpdocs contains:
              > php_value include_path ".|../includes"
              >>
              >I can specify additional subdomains in the control panel of my account.
              >They automatically go in
              > /usr/local/psa/home/vhosts/mydomain.com/subdomains/
              >One of these:
              > /usr/local/psa/home/vhosts/mydomain.com/subdomains/customer
              >which also has the subdirs 'httpdocs' and 'includes'
              >To browse httpdocs/index.php the subdomain the URL reads:
              > http://customer.mydomain.com[/index.php]
              >The .htaccess file in httpdocs is similar to the one in my master domain.
              >PHP recognizes the include_path setting properly, yet fails to open ANY
              >file in the includes directory (e.g.):
              >Fatal error: main() [function.requir e]: Failed opening required
              >'dbconn.inc' (include_path=' .:../includes') in
              >/usr/local/psa/home/vhosts/mydomain.com/subdomains/customer/httpdocs/counter.php
              >on line 4
              >>
              >Permissions are set along the same lines for both master and
              >sub-domains, 'r-x' to others for all subdirs involved, 'r--' for the files.
              >>
              >Any ideas what prevents PHP from opening include files for my
              >subdomains? Open_basedir is set to my root dir btw by H.P., if that
              >makes any difference for this issue.
              >>
              >Hope my message is readable enough. Thanks in advance!
              >Sh.
              >
              the short answer is not to reply on the includes directive/.htaccess
              files, just define the application include root (and any and all other
              paths your application needs) for yourself in your php application and
              then prefix any attempt to open an include with that definition. Your
              application becomes more portable as it doesnt reply on the ability to
              set the includes dir in an .htaccess file. that's what i would do
              anyway!
              >
              Valid point, I'll make sure all stuff in my main domain uses that
              solution instead. The .htaccess solution only existed in my 'testlab'.
              However, in this case that doesn't seem to be the culprit. PHP has the
              include path right, just isn't able to open any files in it.

              Right now a 2nd helpdesk employee is modifying some configs to make
              things work, he thinks he has the solution. Once fixed, I'll ask him
              what exactly caused this behavour, I'll report back here.

              Thanks for the input.
              Sh.

              Comment

              • Rik

                #8
                Re: include_path related issue

                Schraalhans Keukenmeester wrote:
                Rik wrote:
                >Schraalhans Keukenmeester wrote:
                >>Rik wrote:
                >>>Schraalhan s Keukenmeester wrote:
                >>>> php_value include_path ".|../includes"
                >>>>(include_pa th='.:../includes')
                >>>If a unix box, the colon seems correct (windows would have a semicolon).
                >>> I've never seen a pipe use for this though, but that might be my lack
                >>>of OS knowledge and environmental variables.
                >>>>
                >>The pipe was a typo, alas. If only it were so easy, Rik.
                >Wish it was...
                >>
                >>Thanks for your
                >>keen eye though! No news from my provider either. WEIRD!
                >What happens if you try to include it specifically? Does that work or
                >does that give a more clear error?
                No matter what I try, just the filename, or including the relative or
                even full path to the include file, same error, no further specification
                of why this happens.
                Hmmmz, normally I'd say there's probably another open_base_dir
                restriction in effect for the subdomain, that would mean another error
                message though... Are you sure the settings for the subdomain are the
                same as for the main one?
                (Helpdesk people can be really annoying, you tell them you have a
                working solution with include files outside httpdocs which you'd like to
                work for subdomains as well. The reply after two working days: "You
                can't include files outside your httpdocs on the server, that's why it's
                not working." Sigh!!! Guns please!)
                Hehe, I've more then once explained a hoster how to configure Apache to
                my wishes, after being told they didn't think something was possible...
                Helpdesk ignorance is OK if they trust you enough to give them the
                education they lack :-). It's a pain if they're slow though, the bulk of
                the hosters I deal with reply within the hour.
                --
                Rik Wasmus

                Estimated date being able to walk again: 01-05-2007.
                Less then a week, hurray!

                Comment

                • Rik

                  #9
                  Re: include_path related issue

                  Schraalhans Keukenmeester wrote:
                  Right now a 2nd helpdesk employee is modifying some configs to make
                  things work, he thinks he has the solution. Once fixed, I'll ask him
                  what exactly caused this behavour, I'll report back here.
                  OK, awaiting in anticipation.

                  --
                  Rik Wasmus

                  Estimated date being able to walk again: 01-05-2007.
                  Less then a week, hurray!

                  Comment

                  • shimmyshack

                    #10
                    Re: include_path related issue

                    On Apr 26, 3:17 pm, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
                    wrote:
                    Rik wrote:
                    Schraalhans Keukenmeester wrote:
                    Rik wrote:
                    >Schraalhans Keukenmeester wrote:
                    >> php_value include_path ".|../includes"
                    >
                    >>(include_path ='.:../includes')
                    >If a unix box, the colon seems correct (windows would have a semicolon).
                    > I've never seen a pipe use for this though, but that might be my lack
                    >of OS knowledge and environmental variables.
                    >
                    The pipe was a typo, alas. If only it were so easy, Rik.
                    >
                    Wish it was...
                    >
                    Thanks for your
                    keen eye though! No news from my provider either. WEIRD!
                    >
                    What happens if you try to include it specifically? Does that work or
                    does that give a more clear error?
                    >
                    No matter what I try, just the filename, or including the relative or
                    even full path to the include file, same error, no further specification
                    of why this happens.
                    >
                    (Helpdesk people can be really annoying, you tell them you have a
                    working solution with include files outside httpdocs which you'd like to
                    work for subdomains as well. The reply after two working days: "You
                    can't include files outside your httpdocs on the server, that's why it's
                    not working." Sigh!!! Guns please!)
                    it does sound rather as though your setup there is non-standard, it
                    stragely uses .htaccess to fiddle with include paths, when of course
                    you should handle the environment within your app.
                    i wonder if it isnt because there are symbolic links which are
                    resolving to be outside the openbase dir restriction.

                    my advice: name and shame your host with its bad customer service - to
                    me it sounds like http://1and1.co.uk who are also notorious for
                    getting back to you after weeks only to have misunderstood what you
                    asked, and insist on telling you something along the line of "its your
                    browser settings" which means I just dont bother reading their
                    replies!

                    after youve named and shamed them, consider moving to somewhere wher
                    you are in control of your environment, which doesnt depend on
                    architechtural restrictions, which after all wont work on IIS etc...
                    are on apache with htaccess disallowed!

                    Comment

                    • Schraalhans Keukenmeester

                      #11
                      Re: include_path related issue

                      Rik wrote:
                      Schraalhans Keukenmeester wrote:
                      >Rik wrote:
                      >>Schraalhans Keukenmeester wrote:
                      >>>Rik wrote:
                      >>>>Schraalha ns Keukenmeester wrote:
                      >>>>> php_value include_path ".|../includes"
                      >>>>>(include_p ath='.:../includes')
                      >>>>If a unix box, the colon seems correct (windows would have a
                      >>>>semicolon ).
                      >>>> I've never seen a pipe use for this though, but that might be my lack
                      >>>>of OS knowledge and environmental variables.
                      >>>>>
                      >>>The pipe was a typo, alas. If only it were so easy, Rik.
                      >>Wish it was...
                      >>>
                      >>>Thanks for your
                      >>>keen eye though! No news from my provider either. WEIRD!
                      >>What happens if you try to include it specifically? Does that work or
                      >>does that give a more clear error?
                      >No matter what I try, just the filename, or including the relative or
                      >even full path to the include file, same error, no further specification
                      >of why this happens.
                      >
                      Hmmmz, normally I'd say there's probably another open_base_dir
                      restriction in effect for the subdomain, that would mean another error
                      message though... Are you sure the settings for the subdomain are the
                      same as for the main one?
                      >
                      >(Helpdesk people can be really annoying, you tell them you have a
                      >working solution with include files outside httpdocs which you'd like to
                      >work for subdomains as well. The reply after two working days: "You
                      >can't include files outside your httpdocs on the server, that's why it's
                      >not working." Sigh!!! Guns please!)
                      >
                      Hehe, I've more then once explained a hoster how to configure Apache to
                      my wishes, after being told they didn't think something was possible...
                      Helpdesk ignorance is OK if they trust you enough to give them the
                      education they lack :-). It's a pain if they're slow though, the bulk of
                      the hosters I deal with reply within the hour.
                      Issue solved by changing open_basedir for the subdomains. Hosting party
                      have a quite standard CentOS LAMP box, but in their setup open_basedir
                      is set separately for subdomains. Which basically is a good thing.

                      Like you expected Rik, I would have guessed an open_basedir related
                      error message would have reared its ugly head, but appaerantly it does
                      not! Not sure whether this is a general rule or just something related
                      to my specific server setup.

                      I should add some nuance to the remarks about this provider. There is
                      one person who portrays the (unfortunately) 'typical' helpdesk mentality
                      (no can't do, not possible, or just plain no. Doesn't properly read
                      questions etc. You know the type). The others have shown a keen
                      understanding of the matter, usually are swift in their replies and
                      solutions, can handle constructive criticism, are open for sensible
                      suggestions, apply fixes speedily, and are always willing to be
                      pragmatic about all requests I make. After all, the vast majority of
                      their clients probably never burden them with technical stuff. On a
                      whole, I am quite content about them.

                      I pay about 10 euros a month, which isn't an incredible amount, can't
                      expect miracles. That said, I am always open for suggestions about good
                      hosting providers, preferrably in the Netherlands.

                      Thanks for all the suggestions and comments. Glad I got this out of the
                      way. One happy customer coming up today.

                      Regards, enjoy the weather (It's top notch here, welcome climate
                      change!) and have a great weekend all.

                      Sh.

                      Comment

                      Working...