1

I am using MDB2 in an old php project, which I have just moved to a new server.

The project framework relies on some open_basedir config.

But there's something pretty odd.

I get the following error, which says a file /usr/share/pear/MDB2/Driver/mysql.php is not within allowed paths, but then lists the path to the file /usr/share/pear/MDB2/Driver in the list of allowed paths...

Why might this be?

PHP Warning:  is_readable(): open_basedir restriction in effect.
File(/usr/share/pear/MDB2/Driver/mysql.php) is not within the allowed path(s): 
(/var/some-paths:/usr/share/php:/usr/share/pear/MDB2/Driver) in /usr/share/php/MDB2.php on line 933
petesiss
  • 994
  • 13
  • 30
  • 1
    Perhaps you have to use trailing slashes, take a look at https://stackoverflow.com/questions/11603156/php-open-basedir-allowed-path – syck Sep 18 '15 at 08:49
  • Thanks. I wasn't aware that trailing slashes were needed. I tried it, but for some reason in my case it didn't make any difference. The directive works equally well with or without. – petesiss Sep 18 '15 at 11:17

1 Answers1

0

The solution was that the specific file itself didn't exist.

The Pear optional features, like the specific DB types, have to be installed separately and this hadn't been done.

The error message is in a way misleading. I guess technically it is correct, but it makes the error appear to be an issue with open_basedir config rather than a file not found.

petesiss
  • 994
  • 13
  • 30