Sessions and Shared Hosting Provider issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • comp.lang.php

    Sessions and Shared Hosting Provider issue

    I am in the middle of debugging a script that is hanging on
    "session_start( )", which, if I recall, can occur if session.save_pa th
    points to a directory onto which you do not have permission to access
    (I verified and yep, no love on that folder).

    So I figured I'd simply rewrite session.save_pa th:

    <? ini_set('sessio n.save_path', '/path/where/there/is/love'); ?>

    To no avail, because the shared hosting provider also informed me that
    you are not permitted to overwrite the default settings of php.ini
    because it's a shared hosting provider.

    UGH!

    So my next and last idea is to copy over a local copy of php.ini to my
    /[account root folder] directory, however, I am only given access to
    /htdocs and /cgi-bin.

    Obviously /htdocs = BAD IDEA since the known universe can read the
    contents of php.ini via browser, but the shared hosting provider will
    not allow me to move it outside of /htdocs document root folder.

    That leaves /cgi-bin. Is that a good idea? Or do you all have a better
    idea as to what to do? Bottom line: I just want to be able to use
    session_start() , optionally, ini_set().

    I need an answer rather quick as the site is breaking and my boss wants
    an answer before COB today and I am trying to come up with one stat!

    Thanx
    Phil

  • petersprc

    #2
    Re: Sessions and Shared Hosting Provider issue

    Hi,

    session_start might hang if another page already has that session open
    and is running. If that's a possibility, you might want to call
    session_write_c lose() on the other page, or make sure the page
    completes first. There's a note in the comments at
    php.net/session_start about this.

    Changing the session path usually works using ini_set, or .htaccess:

    php_value session.save_pa th /my/home/php-sessions

    The directory should be writable by the web user.

    comp.lang.php wrote:
    I am in the middle of debugging a script that is hanging on
    "session_start( )", which, if I recall, can occur if session.save_pa th
    points to a directory onto which you do not have permission to access
    (I verified and yep, no love on that folder).
    >
    So I figured I'd simply rewrite session.save_pa th:
    >
    <? ini_set('sessio n.save_path', '/path/where/there/is/love'); ?>
    >
    To no avail, because the shared hosting provider also informed me that
    you are not permitted to overwrite the default settings of php.ini
    because it's a shared hosting provider.
    >
    UGH!
    >
    So my next and last idea is to copy over a local copy of php.ini to my
    /[account root folder] directory, however, I am only given access to
    /htdocs and /cgi-bin.
    >
    Obviously /htdocs = BAD IDEA since the known universe can read the
    contents of php.ini via browser, but the shared hosting provider will
    not allow me to move it outside of /htdocs document root folder.
    >
    That leaves /cgi-bin. Is that a good idea? Or do you all have a better
    idea as to what to do? Bottom line: I just want to be able to use
    session_start() , optionally, ini_set().
    >
    I need an answer rather quick as the site is breaking and my boss wants
    an answer before COB today and I am trying to come up with one stat!
    >
    Thanx
    Phil

    Comment

    • comp.lang.php

      #3
      Re: Sessions and Shared Hosting Provider issue


      petersprc wrote:
      Hi,
      >
      session_start might hang if another page already has that session open
      and is running. If that's a possibility, you might want to call
      session_write_c lose() on the other page, or make sure the page
      completes first. There's a note in the comments at
      php.net/session_start about this.
      Actually it's at the top of the main page that's hanging and it is
      calling no other page when it hangs. Should I include
      session_write_c lose() anyway?
      >
      Changing the session path usually works using ini_set, or .htaccess:
      >
      We are not given permission to use ini_set() to make any local changes
      to any variable, including session.save_pa th
      php_value session.save_pa th /my/home/php-sessions
      >
      The directory should be writable by the web user.
      >
      Yeah I tried that, to no avail. We're not allowed to make changes via
      ini_set(); I tried uploading php.ini but I am only given permission to
      load onto either /htdocs or /cgi-bin, neither of which are secure nor
      allow for the local php.ini to function; we are not allowed to write to
      our own chroot.

      Phil
      comp.lang.php wrote:
      I am in the middle of debugging a script that is hanging on
      "session_start( )", which, if I recall, can occur if session.save_pa th
      points to a directory onto which you do not have permission to access
      (I verified and yep, no love on that folder).

      So I figured I'd simply rewrite session.save_pa th:

      <? ini_set('sessio n.save_path', '/path/where/there/is/love'); ?>

      To no avail, because the shared hosting provider also informed me that
      you are not permitted to overwrite the default settings of php.ini
      because it's a shared hosting provider.

      UGH!

      So my next and last idea is to copy over a local copy of php.ini to my
      /[account root folder] directory, however, I am only given access to
      /htdocs and /cgi-bin.

      Obviously /htdocs = BAD IDEA since the known universe can read the
      contents of php.ini via browser, but the shared hosting provider will
      not allow me to move it outside of /htdocs document root folder.

      That leaves /cgi-bin. Is that a good idea? Or do you all have a better
      idea as to what to do? Bottom line: I just want to be able to use
      session_start() , optionally, ini_set().

      I need an answer rather quick as the site is breaking and my boss wants
      an answer before COB today and I am trying to come up with one stat!

      Thanx
      Phil

      Comment

      Working...