I have a Linux server with appache as the web server. In my PHP script I am making directories with 0777 mode. the code is pretty simple as follows:
0777
<
You can try:
chmod ( string $filename , int $mode )
See if that can fix the permissions issue.