You want to use PHP to manage the configuration files for other applications under Linux, such as generating DNSMASQ profiles.
The problem is that PHP is running under the Apache or Nginx, the Operation permission is Www-data or Nginx.
The permissions for the DNSMASQ configuration file are root.
Is there any way to get PHP to temporarily gain read and write access to the DNSMASQ configuration file, and not to give PHP too much permission, or to give other processes access to the DNSMASQ configuration file read and write permissions?
Reply content:
You want to use PHP to manage the configuration files for other applications under Linux, such as generating DNSMASQ profiles.
The problem is that PHP is running under the Apache or Nginx, the Operation permission is Www-data or Nginx.
The permissions for the DNSMASQ configuration file are root.
Is there any way to get PHP to temporarily gain read and write access to the DNSMASQ configuration file, and not to give PHP too much permission, or to give other processes access to the DNSMASQ configuration file read and write permissions?
Add running permissions to the root group