關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • open_basedir 設定多個目錄問題

    Posted on July 9th, 2008 Sam Tang 1 comment

    在 PHP 內有一個安全選項是 open_basedir,這個選項是限制 PHP 可以開啟的目錄,可以透過 php.ini 及 httpd.conf 設定,而我一直也有使用這個選項。

    今天 server 要改一些設定,要將兩個目錄加入 open_basedir 內,發現用論用空格、逗號、分號來區隔兩個目錄都不行,而根據 PHP 官方網站的說法,這個選擇是支援多個目錄的。在 google 找了一下,原來要用冒號來區隔兩個目錄,例如:

    open_basedir "/path/dir1/:/var/tmp/"


     

    One response to “open_basedir 設定多個目錄問題”

    1. 参考http://cn.php.net/manual/en/dir.constants.php

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word