Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_basedir not owrking following paths #13226

Open
paulkudla opened this issue Jan 23, 2024 · 8 comments
Open

open_basedir not owrking following paths #13226

paulkudla opened this issue Jan 23, 2024 · 8 comments

Comments

@paulkudla
Copy link

Description

The following code:
General random Occurances (Word Press Sites)

when using apache server with directory statement

php_admin_value open_basedir /data/www//:/var/log/:/usr/local/share/pear/

or

php_admin_value open_basedir /data/www/:/var/log:/usr/local/share/pear
(ending slashes removed) - documentation is not clear on multiple formtted directories but neither work as expected.

Resulted in this output:Random site crashes

Warning: Unknown: open_basedir restriction in effect. File(/data/www/team.22Racing.ca/index.php) is not within the allowed path(s): (/data/www/team.22Racing.ca/tmp/) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/data/www/team.22Racing.ca/index.php' (include_path='.:/usr/local/share/pear') in Unknown on line 0

Note that both are in the allowed path especially index.php ?

But I expected this output instead:
site should work as NO file(s) are being accessed outside their home directory.

With display errors on you get the error's reported above, with dispaly off it crashes the site so either way open_basedir is blocking file access?

but open_basedir fails anyways, this IS required to keep a shared server secured, aka the wordpress hack years ago that brough down myself, 1and1 hosting etc.

Please note this has been reported in various versions over the years (going back to 5.xx etc), any ticket opened did not carry any real fixes to this issue that appears to be php is not following the allowed path(s) properly into the path sub directories ?

This issue appears weather or not opcache, fpm etc is compiled in or not ?

See Bug(s) Reported 👍
https://bugs.php.net/bug.php?id=78764
https://bobcares.com/blog/wordpress-warning-open_basedir-restriction-in-effect/
https://bugs.php.net/bug.php?id=48880

Please note this is a production server running httpd-2.4.43, memcached, openssl, mod_fcgid-2.3.9, mod_wsgi-4.7.1,

I am trying to update to PHP 8.0.21 to see if that helps and will advise, however I am unable to goto the lastest PHP version due to incompatibility with elegant themes and other site(s) programming.

I am running the latest version of word press if that helps but this seems to be a low level file php issue (rights on all site are correct chmod 755)

I can provide test site duplicating the errors if you wish.

I am here to help, been programming for over 40 years and usually muddle through config issues like this?

PHP Version

PHP php-7.4.33

Operating System

Freebsd 12.1

@devnexen
Copy link
Member

devnexen commented Jan 23, 2024

Note that the whole php 7.x serie is no longer supported. Do you have the possibility to upgrade to a php 8.1/8.2 at least ?

@paulkudla
Copy link
Author

paulkudla commented Jan 23, 2024 via email

@paulkudla
Copy link
Author

paulkudla commented Jan 27, 2024 via email

@paulkudla
Copy link
Author

paulkudla commented Jan 27, 2024 via email

@paulkudla
Copy link
Author

paulkudla commented Jan 27, 2024 via email

@paulkudla
Copy link
Author

paulkudla commented Jan 27, 2024 via email

@paulkudla
Copy link
Author

paulkudla commented Jan 28, 2024 via email

@bukka
Copy link
Member

bukka commented Feb 2, 2024

It looks like something in your application setting open_basedir to subdirectory. You can check the current value by printing ini_get('open_basedir'). I don't think this is a bug in PHP. If you still think it is, then please provide a short script showing the issue with all configuration in effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants