We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

There is a way to configure Phalcon to run as a different user?

Hi, I configured my apache installation to run each virtual server with its own user, i.e.:

<VirtualHost *:80>
      DocumentRoot "/home/user/www"
      ServerName user.it
    ServerAlias *.user.it
      ServerAdmin [email protected]
      AssignUserId user user
      ErrorLog /home/user/log/error-log
      CustomLog /home/user/log/log common
      <Directory "/home/user/www">
              allow from all
              Options +Indexes
              AllowOverride all
              Order allow,deny
      </Directory>
</VirtualHost>

I noticed that since I installer phalcon every file generated by my webapp doesn't belong anymore to user:user, but it know belongs to the default apache user www-data:www-data. Is there a way to change this behavior? I really need each user being able to completely own the files in his directory... Thank you in advance, Simone

This really is not related to Phalcon at all. You would be better off going to somewhere like Server Fault to ask this question.



1.7k

Thanks for your answer, the odd thing is that that virtual server worked properly until I started using phalcon... it seems that if I create a dir from inside a phalcon object this is assigned to www-data, while if I create a dir from a "normal" php script it gets the right user. I'll check on server fault anyway, thanks! S.