Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control the file permissions when the netbeans php plugin uploads a file with FTP

Whenever netbeans preforms an ftp upload the files are uploaded with the permissions set to 640. This causes PHP to throw the following error:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/Library/WebServer/Documents/notes/index.php' (include_path='.:/usr/local/php5/lib/php') in Unknown on line 0

While I can clean it up with a quick chmod o+r ./* in the command prompt it causes netbeans to resynchronize the entire project next time I hit run which in turn sets the permissions back to 640.

I need a way to make netbeans upload the files with permissions set to 644.

like image 356
GameFreak Avatar asked Apr 02 '09 22:04

GameFreak


2 Answers

Make sure the checkbox for "Preserve Remote File Permissions" under Project Properties > Run Configuration is checked, if you want to not change remote file permissions.

like image 160
sanon Avatar answered Oct 25 '22 19:10

sanon


I determined that the problem was not with netbeans. It was with ftpd on the server.

The fix was to create a file called ftpd.conf in /etc/ and add the following line:

umask all 022
like image 40
GameFreak Avatar answered Oct 25 '22 19:10

GameFreak