I haven't used phing before, but want to utilize it to automate my deployment process. Presently I sign in under myuser, Apache runs under www-data. My application code is possessed by myuser, but other (cache) files are produced by www-data.

I presently solve this by utilizing sudo to get rid of these files. I must keep your application code possessed by myuser, since it is simpler to gain access to the files via ssh. I would not like phing to operate with super forces, because now I do not trust this automated tool yet.

What's the best practice to make use of phing with limited file permissions?

When I comprehend it however , phing can't so something with the cache files ever since they were produced because of your Apache user (www-data) and you're simply running phing as myuser. It may sound in my experience like you need to simply alter the permissions around the cache files to ensure that myuser has full permissions. How to get this done will rely on the way your application is written, but something like chmod/chowning'ing the files after creation or creating all of them with a umask permitting myuser permissions.

I'd exactly the same problem. Apache is running as www-data.www.data and files produced through the webserver are 644 and sites 755.

I solved it by:

  1. adding the consumer running phing towards the www-data group
  2. adding umask 002 towards the /etc/apache2/envvar file, see link

Phing is now take away the sites and files produced through the apache