File and Directory permission problem

Hello all,

I am moving my development application to our new VPS hosted server. The problem is that when I upload my folder, all folder permission are set to 0777 and the files are set to 0666. I am using CPanel file manager to upload this files. Can I set the permission in my local xampp folder before I upload this so that it is already set up when I move it to the production server?

Another question is when the assets folder generates the resource files. When I try to change the permission in the file manager for a specific file e.g (update.png) it won’t change and always reverts back to the old permission.

Does anyone had this similar issue before?


  • macbook air 11

  • xampp OS X 1.8.3-5

  • php 5.5


  • CPanel x3 theme

  • php 5.5

Thank you.


if you change the permissions on your local machine it wont effect your VPS you probably have to set up permission on you VPS manually

So I need to change it via ssh I guess. Thank you. My other problem is that the assets resource being generated are somewhat corrupt because I cannot even access it via absolute path. e.g. (cbutton assets/cgdview/12345/update,png). The weird thing is that when I download the update.png file, delete the existing one in the assets folder and then re-upload the update.png file. It is now accessible using the absolute path and also I can edit the permission successfully. I don’t know if this is because I uploaded the entire folder using mac. This is the first time I encountered this issue.

Another thing is that when I upload a file using a form. It is also corrupted since the file exist but it can’t be accessed unless I do the steps mentioned above… :( Previously it is working. so I don’t know if it’s because of the latest upload.

Anyone has an idea how to fix this?


I just want to update my findings. Last time, I dont have any problem moving my files from localhost to our hosting but now I need to set permissions for directory that needs to be writable, delete session.db in runtime folder just to make it work. I uploaded the new one using windows but the same error exists. When I upload a file using a form it returns a 404 error after saving the record but the file exists in the directory.

Thank you,