SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom php.ini for open_basedir

    Hello,

    In vB, I need for it to be able to upload files OUTSIDE of the current directory. However, when I try this I get this error:
    Warning: copy(): open_basedir restriction in effect.

    I've tried reading up on that, but I've come up empty.

    I need for the following directory:
    /home/httpd/vhosts/username/httpdocs

    To be able to access this directory:
    /usr/local/www/htdocs

    Is this possible? I believe it is, but I just don't know how.

    Thank you for your time.

    Sincerely,
    Andrew
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  2. #2
    SitePoint Member
    Join Date
    Apr 2005
    Location
    Nicosia, Cyprus
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is described in PHP manual at safe mode features page. You need to change your php.ini so that open_basedir parameters contains all directories that your scripts can access. Also it can be done for a particular vhost through httpd.conf.

  3. #3
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've read that page but really don't know what to do. I'm just kinda loss with it. Does anyone have any experience with this?
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  4. #4
    SitePoint Member
    Join Date
    Apr 2005
    Location
    Nicosia, Cyprus
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to put all your upload directories into open_basedir in your php.ini. For example it may looks like this:
    Code:
    open_basedir = /tmp:/home/httpd/vhosts/username/httpdocs:/usr/local/www/htdocs
    that allows your scripts to create files in three listed directories.
    You can also change that value through apache's httpd.conf:
    Code:
    php_admin_value open_basedir /tmp:/home/httpd/vhosts/username/httpdocs:/usr/local/www/htdocs


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
  •