Forum Moderators: coopster

Message Too Old, No Replies

asking for help with php error

         

sodani

12:00 am on Oct 18, 2006 (gmt 0)

10+ Year Member



I'm using drupal, and am receiving error messages when I install certain modules, and I can't for the life of me figure out what's wrong. This is the type of error message I've been getting:

•warning: main() [function.main]: open_basedir restriction in effect. File(/actions.inc) is not within the allowed path(s): (/var/www/vhosts/domain.com/httpdocs:/tmp) in /var/www/vhosts/domain.com/httpdocs/dev/modules/actions/actions.module on line 659.
•warning: main(actions.inc) [function.main]: failed to open stream: Operation not permitted in /var/www/vhosts/domain.com/httpdocs/dev/modules/actions/actions.module on line 659.
•warning: main() [function.include]: Failed opening 'actions.inc' for inclusion (include_path='.:') in /var/www/vhosts/domain.com/httpdocs/dev/modules/actions/actions.module on line 659.

It seems like essentially, it's having trouble optening the actions.inc file, but it's in the same folder as actions.module. I've tried this on a different server, and it works fine, which leads me to believe that it's a server issue. Can anyone help?

Psychopsia

12:25 am on Oct 18, 2006 (gmt 0)

10+ Year Member



Hi!
Maybe the Safe Mode [us2.php.net] is affecting the open_basedir [us2.php.net].

I don't know exactly.

sodani

2:26 am on Oct 18, 2006 (gmt 0)

10+ Year Member



I turned safe mode for the local value through plesk, and I'm still having the problem...

coopster

11:49 am on Oct 18, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What does your include_path directive look like, and what container do you have it in if any?

sodani

2:58 am on Oct 19, 2006 (gmt 0)

10+ Year Member



It just says ".:" without the quotes

coopster

6:33 pm on Oct 19, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The dot represents the current working directory, the colon is a path separator. Looks like it is looking in the current working path for your included file. I found this old discussion that somewhat covers how include paths are searched ...
[webmasterworld.com...]

sodani

3:27 am on Oct 25, 2006 (gmt 0)

10+ Year Member



I'm continuing to have problems with this server. Here's another error I'm getting with a different module. As expected, it works fine on my other server.

• warning: opendir(files/test_fileshare_page3) [function.opendir]: failed to open dir: Not a directory in /var/www/vhosts/domain.com/httpdocs/dev/modules/fileshare/fileshare.module on line 560.
• warning: readdir(): supplied argument is not a valid Directory resource in /var/www/vhosts/domain.com/httpdocs/dev/modules/fileshare/fileshare.module on line 561.
• warning: sort() expects parameter 1 to be array, null given in /var/www/vhosts/domain.com/httpdocs/dev/modules/fileshare/fileshare.module on line 564.
• warning: closedir(): supplied argument is not a valid Directory resource in /var/www/vhosts/domain.com/httpdocs/dev/modules/fileshare/fileshare.module on line 614.

Someone in the drupal forum was telling me that the problem was with the module, but this has happened with 3 or 4 different modules, and they all work fine on my other server, so I'm pretty convinced that this is a php config issue. Just have no idea what.

coopster

2:12 pm on Oct 25, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If your include path is outside your DOCUMENT_ROOT you need to setup your configuration accordingly. With plesk, that often means you need to setup a
vhost.conf
included configuration file (plesk has it's own
httpd.include
configuration file per domain and if it finds a
vhost.conf
and/or
vhost_ssl.conf
it will include them at the base of it's own configuration -- after you "rebuild" the configuration using the plesk command line tool and of course you need to restart apache). The directive might look something along these lines ...

<Directory /var/www/vhosts/@domain_name@/httpdocs> 
AddHandler php5-script htm html
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "/var/www/vhosts/@domain_name@/httpdocs:/tmp:/var/www/path/to/your/includes"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_value open_basedir "/var/www/vhosts/@domain_name@/httpdocs:/tmp:/var/www/path/to/your/includes"
</IfModule>
</Directory>
php_value include_path "/var/www/path/to/your/includes:."

sodani

2:33 am on Oct 29, 2006 (gmt 0)

10+ Year Member



However the include file is in the same directory as the file that's calling it. Does that make sense?

sodani

9:28 pm on Nov 4, 2006 (gmt 0)

10+ Year Member



Adding the following code to the .htaccess file for the particular domain seemed to work:


php_value include_path '.:/var/www/path/to/your/includes"

However, given that bit of information, I'd be curious about whether there are any adjustments I can't make to the entire server.

coopster

11:13 pm on Nov 6, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If all the domains on the server share the same include files then you can make the changes in your php.ini configuration. However, that is often not the case. You will likely have different include files for each domain on the server, meaning they will be domain specific. For those that are shared though, you could put them in a common shared path and include that path in your configuration directive as mentioned.