Hello everyone, I work in netbeans, but when php creates or edits files, it sets privileges only for www, and since Netbeans is not running under root, then you understand ... Is it possible to give Netbeans root privileges on ubuntu? I can run it from root, but then another Netbeans will open, not the same one in which I have a project and all the settings. How to be? I ask for advice Thank you.

  • когда php создает или редактирует файлы он ставит привилегии только для www - How is this possible? What files does it edit? Why then rule them in the Neatbeans? chown to chown you;) - E_p
  • You probably rule the code directly in /var/www/html ? This is not a good idea. As an option, you can make a sim link. ln -s /your/project/folder /var/www/html . just delete /var/www/html - E_p
  • There are about 30 files that php creates on the model, in this sample I forget to correct the <title> page))) And now I think, manually change the titles and correct in the sample, do not create all these 30 files again through the admin panel - hovdev
  • rather it creates one file, but more than 30 have already created - hovdev
  • maybe when you have linux and php as an apache2 module - hovdev

2 answers 2

You have 2 options

Copy your netbeans root profile

sudo cp -R /home/youruser/.netbeans /root/

and then run netbeans from under the root

Change file ownership

sudo chown youruser -R /path/to/files

correct later

sudo chown www-data -R /path/to/files

    It’s normal to set up virtualhost in apache and don’t suffer from root and netbeans bullshit. You create the www folder in your home folder, configure apache from your user https://interface31.ru/tech_it/2015/06/nastraivaem-veb-server-na-baze -apache-v-debian-ubuntu-server.html

    https://dyrik.ru/linux/ustanovka-apache2-mpm-itk-v-ubuntu-16-04.html