Charles2008
This page
http://wiki.contribs.org/DB_Variables_Configuration#Apache_server_ibay_specific_.28httpd-e-smith.29lists the default PHP base dir location for an ibay when not specified by a db commands as being
/home/e-smith/files/ibays/ibayname
So if PHP tries to write to other folders then it gives an error.
Commonly php apps are configured by default to to write to /tmp or ....ibays/ibayname/html/tmp
To clarify, this is the generic form of the command
db accounts setprop ibayname PHPBaseDir DIR1:DIR2:DIRn
signal-event ibay-modify ibayname
Example
db accounts setprop myibay PHPBaseDir /home/e-smith/files/ibays/myibay/:/tmp
signal-event ibay-modify myibay
This actually specifies two directories (or more if required), the colon seperator allows the entry of additional directories that PHP can access, and the trailing slash limits access to that directory only (and I believe not to sub directories under that folder).
Using the above gives PHP access to the myibay ibay folder and to (top level) /tmp
For security reasons the /tmp folder should not be used as a common folder by different ibays or webapps (wherever installed) so as to avoid cross site hacking, where bad code can be injected into the /tmp folder from one app, and then affect (or infect) other site apps using the same /tmp folder.
If you want to give access only to the tmp folder within an ibay, which is a much more secure approach (and generally recommended), then this would be appropriate
db accounts setprop myibay PHPBaseDir /home/e-smith/files/ibays/myibay/html/tmp/
If the site requires other folders to be accessed by PHP, then specify a second location as follows, while still keeping (using) the original tmp location within the ibay structure.
db accounts setprop myibay PHPBaseDir /home/e-smith/files/ibays/myibay/html/tmp/:/someotherfolder/tmp/
I think the PHP wiki articles need some updating & clarification, as the commands vary slightly depending where you read it, and while they are correct they are also confusing & possibly even misleading, and suggesting less secure methods (by using a common /tmp).
This post
http://forums.contribs.org/index.php/topic,45422.msg221400.html#msg221400and a few others on the forum talk about the concept, although note that the author has his command incorrect as the ibay name is in the wrong location in the db command (a typo ?).
Search the forums on PHPBaseDir if you are interested.
I even wrote a good one back in 2010 here
http://forums.contribs.org/index.php/topic,42799.msg224749.html#msg224749although I think I made a typo too !!!
Hope this is all correct and make sense.