I have a relatively simple custom installation profile for Drupal 8.
All it does is:
- Ask for the sites domain name and the name of the theme it should scaffold.
- Use the domain name to create the proper multi-site folder in
/sites/<domain-name>
- Use the theme name to create a theme folder under the multisite folder:
/sites/<domain-name>/themes/custom/<theme-name>
- Copy the relevant example files to the domain and theme folder, from the default site.
- Use the domain name to create the proper multi-site folder in
The problem I'm having is that it fails at creating the folders, due to it not being permitted to create the folders.
The /sites
is set to permission 0755, and the problem is only fixed if I set sites to have permission 0777.
The folders are created using PHP's mkdir()
function, as is set to create the folders recursively.
Questions:
Is there a better way to make folders during installation, than using php's
mkdir()
, that would fix my permission issue?My assumption would be that the script (drupals installation UI) is being run as a different user than the one who owns the folder/filers of the site (installed via cli git and composer). How to I check which user the script is being run under? (using apache2 on centos7, in case it is relevant)