I cloned the current repo to my ubuntu system. I switched to the 4.0-dev branch and ran composer install and npm-ce. All seemed OK. When I attempt to access the installation I get an immediate 500 error.
Using phpstorm I tracked this down to the file namespace.php at line 93 attempting to require /administrator/cache/autoload_psr4.php this file does not exist in my virgin installation.
I should get the J! installation start page.
No, I also checked. And it works with Joomla 3.x.
And the System is based on Linux.
PHP is 7.4.5
It appears to be a permission problem. On ubuntu cloning the repo as a normal user the directlry and file permissions are not set so:
drwxr-xr-x 11 joomla www-data 4096 Jun 4 07:23 ./
drwxr-xr-x 24 joomla www-data 4096 Jun 4 07:55 ../
drwxr-xr-x 2 joomla www-data 4096 Jun 4 07:20 cache/
drwxr-xr-x 37 joomla www-data 4096 Jun 4 07:23 components/
drwxr-xr-x 3 joomla www-data 4096 Jun 4 07:23 help/
drwxr-xr-x 2 joomla www-data 4096 Jun 4 07:23 includes/
-rw-r--r-- 1 joomla www-data 1064 Jun 4 07:23 index.php
drwxr-xr-x 4 joomla www-data 4096 Jun 4 07:20 language/
drwxr-xr-x 2 joomla www-data 4096 Jun 4 07:20 logs/
drwxr-xr-x 5 joomla www-data 4096 Jun 4 07:20 manifests/
drwxr-xr-x 25 joomla www-data 4096 Jun 4 07:23 modules/
drwxr-xr-x 4 joomla www-data 4096 Jun 4 07:23 templates/
which is 0755 per the documentation, but the joomla system seems not to be able to create the autoloader file. Changing the permissions to 0775 allows joomla to start. What should the permissions actually be in order for Joomla to start without a permission change when running from a git repo?
Also, shouldn't the process that is attempting to create this autoloader file throw an exception when it tries to create it? The exception that is being thrown is not very explanatory of what the real problem is.
I am running php 7.3.11 on Ubuntu 19.10
@skurvish How are the permissions for the parent folder of the Joomla root set? Maybe there is some sticky bit set? And how are your default permissions for creating new files? You can see those by using the umask
command, see [e.g. https://geek-university.com/linux/set-the-default-permissions-for-newly-created-files/](e.g. https://geek-university.com/linux/set-the-default-permissions-for-newly-created-files/).
Permissions should be 744 for folders and 644 for files, with a fex exceptions which are set to readonly by Joomla after an edit, like e.g. configuration.php. It is also important that user and group fit to user and group of the webserver, but this looks ok in the above listing.
I set the rights to 775 here before the post.
I have now also tested with PHP 7.3.17. Same result.
umask shows 0022. A newly created directory has permissions 0755 and a newly created file has 0644
Sorry ... The attribute field is wrong ... the right of the tmp directory is shown correctly.
@Mansaylon I am not talking about the rights you set for existing files, I am talking about the default permissions used for newly created files, which are shown and set by the umask
command.
@Mansaylon it isn't clear to me, are you seeing the same issue as I am with a newly built Joomla from the repo?
If I set folders to 775 everything appears to work. I get the installation startup page. Haven't gone any further just yet but will be doing so shortly.
Same with 777.
But stop now.... I will rebuilt the installation.
Delete everything and reinstall.
I'll get back to you later. ;)
Thanks
@skurvish I guess you meant "777" in your previous post?
If yes, are you running Apache as webserver?
If yes, check if it is running with the right user and group by checking following entries in your apache config file:
User joomla
Group www-data
(if your user and group is same as in your listing)
I am able to complete the installation using 0775 permissions on the directories. Not sure what this says about installing from the repo though. Are other permissions required to be set post clone? Or should the repo have the correct permissions post clone?
The permissions in the CMS repo are correct. If they are also correct on your local clone depends on your local OS setting, like I said, default permissions for files and folders and for the parent folder of the clone.
@richard67 Apache2 user and group are both www-data. The user joomla has group rights to www-data
@skurvish So would you say your issue here is solved? If yes, close it please or ping me here then I can close it for you.
@Mansaylon If you still have issues different to that one, please open a new issue. If group is always set right (a sticky bit for the webserver root or the joomla root so that the folder has permission "drwxrwsr-x" could help to make sure that the group is always right), then there should not be a problem when having 755 for folders and 644 for files.
@richard67 Well, not sure if I would say it was resolved or not just yet.I would like to confirm why the clone is not working from a fresh clone.
When I clone the repo the permissions on the joomla-cms directory are 755 and the ownership is joomla:www-data.
So my question is, do I have a base configuration issue with apache2 or through my umask that cause the installation to fail?
Unfortunately I have no direct access to the server. It is web hosting.
I have just given a ticket to the hoster.
@Mansaylon So your issue is not a Joomla core issue, right?
This I will check now
OK, so I was able to perform a fresh clone and was successful in going through the installation procedure. What I had to do was change the apache2 user to (in my case) joomla.
Normally the ownership of the joomla directory tree should be www-data:www-data. When cloning the repo the user ownership is set to the user who performed the clone. For most people it makes sense to change the clone ownership to www-data:www-data.
I have a particular reason for wanting the user ownership to be something other than www-data and that is what was causing the original error.
I think though that the exception being thrown should be thrown at the point the file is attempting to be created rather than significantly further along the execution chain where the exception doesn't really help one determine what the problem is. But as I am now working I will not pursue this but the developers might consider pursuing yourselves.
I don't see how to close this in the tracker. Where do I find this?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-06-04 14:42:06 |
Closed_By | ⇒ | richard67 |
@skurvish In the tracker you edit the item and change status to closed. or you go to GitHub and use the button at the bottom. Or you ask someone like me to do it ;-) I do it for you now.
Thanks for testing Joomla and reporting issues, even if this time it was not a core issue. But maybe next time you catch one, and that will be a help.
Closed as not a Joomla core issue. Feel free to reopen it if it turns out that this is wrong.
@skurvish That file should be generated automatically. Maybe wrong permissions for folder /administrator/cache/? Or wrong user running the webserver? Does your webserver run on Windows or Linux?