Project

General

Profile

Actions

Bug #98152

closed

PHP Warning: file_exists(): open_basedir restriction in effect.

Added by Lina Wolf over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2022-08-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

FileNotFoundBackend.patch (904 Bytes) FileNotFoundBackend.patch Lina Wolf, 2022-08-16 09:37

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #98106: fix for 97939 creates open_basedir restriction for "relative" absolute urlsClosed2022-08-09

Actions
Related to TYPO3 Core - Bug #98545: file_exists(): open_basedir restriction in effectClosed2022-10-07

Actions
Related to TYPO3 Core - Bug #98330: PHP warning log with EXT-syntax using asset vh in BEClosed2022-09-12

Actions
Actions #1

Updated by Lina Wolf over 2 years ago

  • Related to Bug #98106: fix for 97939 creates open_basedir restriction for "relative" absolute urls added
Actions #2

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

Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

Updated by Benni Mack over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

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

Actions #8

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.

Actions #9

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.

Actions #10

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions #11

Updated by Benedikt Imminger about 2 years ago

  • Related to Bug #98545: file_exists(): open_basedir restriction in effect added
Actions #12

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.

Actions #13

Updated by Benni Mack about 2 years ago

  • Related to Bug #98330: PHP warning log with EXT-syntax using asset vh in BE added
Actions

Also available in: Atom PDF