I have the below settings in my supervisor/conf.d/myconf.conf file :
[program:my-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var
For solving this problem I did the following :
Set the group id of the storage directory and all its sub-directories. Every file created in this directory will have www-data as group.
sudo chgrp -r www-data storage
sudo chmod +R g+s storage
Add the
running the script to the group www-data
sudo usermod -a -G www-data user