What user?

We have Webmin/Virtualmin installation on Centos and we are in the process of migrating a OpenCart site from another server, the site is overall running fine however in the error log is reporting loads of Permission denied errors see:

2013-12-19 15:29:44 - PHP Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/path/to/public_html/image/cache/data/import/prods/38-156x156.jpg’ for writing: Permission denied in /path/to/public_html/system/library/image.php on line 45
2013-12-19 15:29:45 -

We’ve set the folder owner to apache with 775 permissions and this hasn’t helped.

Does anyone know if this is a user or permission issue, what users do the scripts run as e.g. ‘web’, ‘apache’ etc or should it be the FTP user?


By default, website content is executed as the domain owner, rather than the Apache user.

If the PHP Execution Mode is either FCGID, or CGI, your “’/path/to/public_html/image/cache/data/import/prods/” directory should be owned by the Virtual Server owner.


I also ran into this a few times, it’s easy to miss actually - usually using chown/chgrp user -R public_html solved the issue - I was actually going to suggest to add a validation mode to virtualmin which specifically checks for such things.

This happened to me a few times when I was installing stuff as another user (i.e. root) and forgot to change permissions afterwards - many things would still work, but some would break in subtle ways.

Basically, it would be a good idea if vmin could specifically check if the user/group permissions are properly set in public_html, according to the vhost directives by recursively traversing the folder - it’s a common thing that popular scripts like wordpress do during installation, but many others don’t - so it would be kinda cool if vmin could lend a helping hand and detect such circumstances - especially in scenarios like migrations, where this could help validate a modified setup.

There’s the function “Virtualmin ->Limits and Validation -> Fix Permissions”, would that do what you’re after?