Koozali.org: home of the SME Server

How to allow a PHP script to access files in another ibay?

cnp

How to allow a PHP script to access files in another ibay?
« on: January 18, 2005, 01:43:36 AM »
Running on SME Server 6.0.1-01.

With the script below I am trying to list the content of an ibay other than where the script is placed.

But without any luck!

$dir = "/home/e-smith/files/ibays/music/files";
$dirhandle = opendir($dir);
while (($file = readdir($dirhandle)) !== false) {
      echo $file . "<br/>";
}
closedir($dirhandle);

I need a hint on where to change the read permissions for /home/e-smith/files/ibays/music/files so that the above PHP script will work.

Your help is very much appreciated. Thanks in advance.
CNP

ClaudioG

How to allow a PHP script to access files in another ibay?
« Reply #1 on: January 19, 2005, 01:14:22 PM »
You need to modify PHPBaseDir for origin ibay

Command (from console):

/sbin/e-smith/db accounts setprop <ibay-name> PHPBasedir <dir>:<dir>:...

/sbin/e-smith/signal-event ibays-modify <ibay-name>


Default configuration has open_base_dir in httpd.conf like: /home/e-smith/files/ibays/<ibays-name>.
you need to add
/home/e-smith/files/ibays/<destination-ibays-name>

Please: note that this is a security-related-configuration! Add only the real path you nedd.

Regards
ClaudioG