• Post Reply Bookmark Topic Watch Topic
  • New Topic

root file edit with an IDE  RSS feed

 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys I had a problem today at work using Netbeans, the IDE. (just doing research) I tried finding information online, but really there is nothing; maybe because people use VIM or sublime.

Anyhow, to code in PHP/Mysql I use VIM and I ususally need to #SU (go into root) in order to write and edit my index.php file under /var/www/html

however, I wanted to try using Netbeans but I can not open a new project under /var/www/html since it says it is unwritable. I can not just change the permissions in root, so how would I be able to add a project using IDE, netbeans in the /var/www/html directory?
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot use any editor to edit a file that you don't have permissions for, whether it's vi, emacs, or a full-blown IDE. The fact that it's in the root directory is immaterial.

You could start the IDE up under sudo and thus run with root permissions, but that does carry the risk that you'd forget and accidentally zap something important.

However, /var/www is often owned by the "apache" user group, and if you added your userid to that group, you'd be able to edit any file in there that allowed group users to write it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!