open_basedir restriction even though dir is in the list?!

Questions regaring MySQL and PHP may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
User avatar
cread
Versed
Versed
Posts: 255
Joined: Sat Jan 08, 2011 5:56 am

open_basedir restriction even though dir is in the list?!

Postby cread » Mon Mar 05, 2012 3:41 am

I have been developing a php/sql web app to control my thermostat. I would like to place the common files/classes in an separate include path so I can separate my web scripts and cron scripts. I have added the include_path directive to php.ini (including adding the default one that was added elsewhere). I found that the open_basedir restriction was also in effect for included files, so in the DS GUI I added this new include dir to the open_basedir list.
info.php shows the following:

Code: Select all

include_path   .:/volume1/homes/me/php_include:/usr/syno/php/lib/php   .:/volume1/homes/me/php_include:/usr/syno/php/lib/php

and

Code: Select all

open_basedir   /volume1/homes/me/php_include:/etc.defaults:/usr/bin/php:/usr/syno/synoman:/etc:/var/run:/tmp:/var/spool/php:/volume1/@tmp/php:/var/services/web:/var/services/photo:/var/services/blog:/var/services/homes

Yet I get the following error

Code: Select all

Warning: require_once(): open_basedir restriction in effect. File(/volume1/homes/me/php_include/tstat_configuration.php) is not within the allowed path(s): (/volume1/homes/me/php_include:/etc.defaults:/usr/bin/php:/usr/syno/synoman:/etc:/var/run:/tmp:/var/spool/php:/volume1/@tmp/php:/var/services/web:/var/services/photo:/var/services/blog:/var/services/homes) in /volume1/web/tstat/tstat_common.php on line 16 Warning: require_once(/volume1/homes/me/php_include/tstat_configuration.php): failed to open stream: Operation not permitted in /volume1/web/tstat/tstat_common.php on line 16 Fatal error: require_once(): Failed opening required 'tstat_configuration.php' (include_path='.:/volume1/homes/me/php_include:/usr/syno/php/lib/php') in /volume1/web/tstat/tstat_common.php on line 16

If you notice the error states that the path of the file is indeed in the "allowed path(s)"
I restarted PHP and apache, I also have rebooted the server. I also searched here, but there were no similar problems and some seem to have this working. Could this be a new issue with 4.0b? Is there more to mod than open_basedir and include_path?

Thanks
- Chip
DS211, DSM 6.0.1-7393-1, 2x HGST NAS 4T HDN724040ALE640, USB backup of DS, APC UPS
Surveillance, File, Web, Audio, & Photo Stations, Time Backup, built in Backup, CalDav, MariaDB, PHP, (SMB, WebDAV, FTP)
PC= Win7, I7-860 Trubo@3.5G, 8G, and 5T HD's installed
User avatar
cread
Versed
Versed
Posts: 255
Joined: Sat Jan 08, 2011 5:56 am

Re: open_basedir restriction even though dir is in the list?

Postby cread » Fri Mar 16, 2012 3:19 am

Update:
It is working now. I moved to a mapped drive rather than a user's home directory. No idea why it made a difference. All of the unix properties are the same. :?: (Owner, group, RWX...) :?:
- Chip
DS211, DSM 6.0.1-7393-1, 2x HGST NAS 4T HDN724040ALE640, USB backup of DS, APC UPS
Surveillance, File, Web, Audio, & Photo Stations, Time Backup, built in Backup, CalDav, MariaDB, PHP, (SMB, WebDAV, FTP)
PC= Win7, I7-860 Trubo@3.5G, 8G, and 5T HD's installed
Eduardo
Novice
Novice
Posts: 47
Joined: Wed Nov 07, 2012 3:20 pm
Location: Spain

Re: open_basedir restriction even though dir is in the list?

Postby Eduardo » Mon Nov 12, 2012 9:49 pm

Hi,

The same here. DSM 4.1. Open_basedir without results when including a /volume1/homes/...
I can't understand why.
zyrill
Trainee
Trainee
Posts: 13
Joined: Tue Sep 08, 2015 7:28 pm

Re: open_basedir restriction even though dir is in the list?

Postby zyrill » Tue Sep 08, 2015 7:30 pm

Same problem here on DSM 5.2-5592 Update 4. I thought I was too stupid but it seems to be a bug in DSM...

Return to “MySQL/PHP Mods”

Who is online

Users browsing this forum: No registered users and 0 guests