I want to create folders like /var/www/myproject/image/DYNAMIC_FOLDER using server side scripting language PHP, so I edited /etc/sudoers and added the following line:
www-data ALL=(ALL) NOPASSWD : ALL
but while considering security, it is vulnerable as the user www-data can execute any command. In order to avoid this, I would like to give only folder create and delete permissions to www-data. How can I do this?