I've got a Linux server with appache because the web server. During my PHP script I'm making sites with 0777 mode. the code is fairly simple the following:

mkdir($path,0777)

after i run this script and visit my server file manager, the folder can there be however the permission designated to that particular folder is 0755. I can not understand why this really is happening!! once the folder is produced the consumer column has apache inside it however the permission is 0755.

You should attempt using the umask

$old = umask(0); 
mkdir($path,0777); 
umask($old); 

You can test:

chmod ( string $filename , int $mode )

Find out if that may fix the permissions problem.

Apache might possibly not have the permissions to alter this. You skill is. Make certain that apache is running within the same group as the current files group. Then apache will have the ability to make changes to that particular file. You are able to change you apache group within this apache config. Or even the simplest strategy is to alter the whole project user to become the apache user. Then apache could make w.e changes it wants.

visit the file out of your server and kind ls -al and check out the consumer and group

Might be your umask:

<?php
$old = umask(0);
mkdir($dir,0777);
mask($old);
?>