dokuwiki-plugin-dw2pdf icon indicating copy to clipboard operation
dokuwiki-plugin-dw2pdf copied to clipboard

open_basedir restriction violation

Open xi opened this issue 3 years ago • 2 comments

I was unable to open a enerated PDF file because it started with a few lines of PHP warnings like this:

<br />
<b>Warning</b>:  is_file(): open_basedir restriction in effect. File(/wiki/lib/styles/../images/error.png) is not within the allowed path(s): (/srv/www/htdocs/example/www.example.com/:/mnt/php/upload:/usr/share/php:/var/lib/php) in <b>/srv/www/htdocs/example/www.example.com/wiki/lib/plugins/dw2pdf/vendor/mpdf/mpdf/src/Mpdf.php</b> on line <b>11455</b><br />

This looks like it is trying to open a URL path instead of a filesystem path.

xi avatar Jan 06 '22 12:01 xi

I guess some paths need to be added to your basedir setting.

Klap-in avatar Jan 06 '22 13:01 Klap-in

No, /wiki/ definitely does not need to be added to the basedir setting because it does not exist. This path should either be an absolute path that actually exists (e.g. /srv/www/htdocs/example/www.example.com/wiki/lib/styles/../images/error.png) or a relative path (e.g. lib/styles/../images/error.png).

xi avatar Jan 06 '22 13:01 xi

Duplicate of #453
please continue there discussion.

Klap-in avatar Oct 08 '22 19:10 Klap-in

Fixed by https://github.com/splitbrain/dokuwiki-plugin-dw2pdf/commit/045bdeeae777ce42f45a16bdb2cf7c7539410dd2

Klap-in avatar Oct 08 '22 20:10 Klap-in