Bug #98152
closedPHP Warning: file_exists(): open_basedir restriction in effect.
100%
Description
Is probably related to https://forge.typo3.org/issues/98106 but happens in the backend context.
To 11.5.14 I had the described problem both in frond-end (in a custom Middleware) and backend (in the backend modules of apache-solr-for-typo3/solr:11.5.0-rc-3).
Upon opening any of the backend modules of EXT:solr the following error is displayed:
PHP Warning: file_exists(): open_basedir restriction in effect. File(/typo3conf/ext/solr/Resources/Public/StyleSheets/Backend/InfoModule.css) is not within the allowed path(s): (/home/www/mycompany/sites/) in /home/www/mycompany/sites/include/example.de/relaunch/releases/123.456/web/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2321
The error appears only on out staging and productive system and we were not able to reproduce it locally on ddev. However it happens on each call to the backend modules on the stage server.
Applying change https://review.typo3.org/c/Packages/TYPO3.CMS/+/75368 as patch solved the problem in the frontend but not backend. Attached is a patch with a quick fix that made the Backend modules display in the backend for me without errors. Though this is probably a dirty fix.
Files
Updated by Lina Wolf over 2 years ago
- Related to Bug #98106: fix for 97939 creates open_basedir restriction for "relative" absolute urls added
Updated by Gerrit Code Review over 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75477
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75477
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75493
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75494
Updated by Benni Mack over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 92754a33ffe818381a34d06e939c05be2933b07d.
Updated by Benedikt Imminger about 2 years ago
Does anyone else still have this issue despite running TYPO3 11.5.16 (which includes the fix)?
E.g. with EXT:form:
PHP Warning: file_exists(): open_basedir restriction in effect. File(/typo3/sysext/form/Resources/Public/Css/form.css) is not within the allowed path(s)
(see: https://github.com/TYPO3-CMS/form/blob/v11.5.16/Resources/Private/Backend/Layouts/FormManager.html#L2 | FormManager.html was shipped with 11.5.16 but has been removed since then)
Also happens with EXT:formlog which integrates CSS files like this:
https://github.com/pagemachine/typo3-formlog/blob/master/Resources/Private/Templates/Backend/FormLog/Index.html#L8
Updated by Marco Kuprat about 2 years ago
Yes, I still have that problem on my TYPO3 11.5.16 dev environment with a backend module that brings own CSS and JS files.
sys_log receives "open_basedir" PHP warnings each time the backend module is used.
A workaround may be to add the @-operator in line 2317 of typo3/sysext/core/Classes/Utility/GeneralUtility.php :
$fileExists = @file_exists($path);
So I regard this as not yet resolved.
Updated by Benni Mack about 2 years ago
Can you please open a new ticket? We only create one change Git commit / merge per ticket and need a new one. I will then follow up on it.
Updated by Benedikt Imminger about 2 years ago
- Related to Bug #98545: file_exists(): open_basedir restriction in effect added
Updated by Benedikt Imminger about 2 years ago
I created a new ticket here: https://forge.typo3.org/issues/98545
Thank you for looking into this issue.
Updated by Benni Mack about 2 years ago
- Related to Bug #98330: PHP warning log with EXT-syntax using asset vh in BE added