vagrant up by apache user

Install centos 6 on vagrant + virtualbox and make it php’s local development environment.

If you use vagrant, the execution user becomes ‘vagrant’, but is it possible to make it ‘apache’?

I created ssh.config in the directory where vagrantFile exists and tried to make user ‘apache’, but it did not work.

<?php exec("whoiam"); ?>  return 'vagrant'

The reason for this is because the executing user of the production environment is ‘apache’, so we want to match the local development environment with the production environment.


Source: stackoverflow-php