SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Session object unserialize and open_basedir restriction error

    Hi,
    I've just uploaded a site to my server, and I'm getting a weird error. The site has a number of custom classes, in the folder application/library/, and this folder is being added to the include path so I can easily use the auto load function to include the classes (the class names are directly relate to the file names).

    However, there seems to be a problem when objects stored in sessions are unserialized, because it looks as though for some reason, when loading the classes back in, it's putting a / at the beginning of the path, making it an absolute path when it shouldn't be. Because of this, and the open_basedir restriction, I'm getting a fatal error:

    open_basedir restriction in effect. File(/App/Shop/Basket.php) is not within the allowed path(s): (/var/www/vhosts/example.com/httpdocs:/tmp)'
    But this is wrong, because the file is within open_basedir, its located at /var/www/vhosts/example.com/httpdocs/application/library/App/Shop/Basket.php

    Is the the fault of PHP, or my scripts? Does anyone know how to fix it?
    Thanks,
    Jack

  2. #2
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you probably will have to reprogram the code to not append the slash. Even if it does, remove the first slash with something like :

    PHP Code:
    if(strpos($path'/' ) === )  $path substr($path1); 

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply. After some investigation it turns out that the file is actually being included, and the error is the result of something else. Still trying to work out what though.


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
  •