Warning messages: can't find queries

thomas74 - March 24, 2008 - 19:25
Project:RelatedContent
Version:5.x-1.6
Component:Miscellaneous
Category:support request
Priority:critical
Assigned:TBarregren
Status:closed
Description

Hello,

I used the Related Content module with succes in the past (in combination with Simplenews), but now I get warning messages. First when I configure the newsletter issue content type (I negelected that) and later when I want to add related content to the newsletter node. Messages are:

* warning: _relatedcontent_db_query() [function.-relatedcontent-db-query]: open_basedir restriction in effect. File(/relatedcontent.mysql.inc) is not within the allowed path(s): (/var/www/vhosts/wt-invest.com/httpdocs:/tmp) in /var/www/vhosts/wt-invest.com/httpdocs/modules/relatedcontent/relatedcontent.module on line 1486.
* warning: _relatedcontent_db_query(relatedcontent.mysql.inc) [function.-relatedcontent-db-query]: failed to open stream: Operation not permitted in /var/www/vhosts/wt-invest.com/httpdocs/modules/relatedcontent/relatedcontent.module on line 1486.
* warning: _relatedcontent_db_query() [function.include]: Failed opening 'relatedcontent.mysql.inc' for inclusion (include_path='.:') in /var/www/vhosts/wt-invest.com/httpdocs/modules/relatedcontent/relatedcontent.module on line 1486.
* RelatedContent can't find the '_relatedcontent_db_load' query for mysql.
* RelatedContent can't find the '_relatedcontent_db_content_type' query for .
* RelatedContent can't find the '_relatedcontent_db_load' query for .

And the related content tab won't show in the node.
I truly hope someone can help.

#1

Benjamin Melançon - March 24, 2008 - 23:17
Project:Related Content» RelatedContent
Version:<none>» 5.x-1.x-dev

placing in proper project (RelatedContent no space)

#2

TBarregren - March 25, 2008 - 08:55
Version:5.x-1.x-dev» 5.x-1.6
Assigned to:Anonymous» TBarregren

Your PHP installation is using a too restrictive open_basedir restriction.

The error message is due to relatedcontent.module failing to include relatedcontent.mysql.inc on line 1486 of version 5.x-1.x of relatedcontent.module.

To fix the problem, you need to change the open_basedir restriction of your PHP installation to allow modules to include other files in the same directories as the modules themselves. This can be done by editing the php.ini file itself, or by adding the php_admin_value open_basedir ... directive in the main configuration file of your Apache server, or in the virtual host directive of your domain.

If you have no access to any of these configurations files, you can as a last resort, hack the module by replacing the lines 1475--1488 of relatedcontent.module with lines 43-114 of relatedcontent.mysql.inc. But that is of course a less good solution. :-)

I have changed the version from 5.x-1.x-dev to 5.x-1.6 because your error message indicates that it is that version you are using. if not, you need to adjust the line numbers above.

#3

thomas74 - March 25, 2008 - 16:19

Hi,
Thanx for you quick reply.
I host my website extarnal so i don't have acces to the configuration files (php.ini and httpd.conf). I tried your dirty solution bij simply including the queries (lines 43 - 114 in relatedcontent.mysql.inc) in relatedcontent.module (lines 1475 - 1488) but the result is a blank page when I open a content type. So that didn't work.

For now I contacted my host with the request to change the open_basedir settings in php.ini. Btw, I use this module without any problems for other websites, also hosted by the same ISP.

#4

TBarregren - March 25, 2008 - 16:51

Stupid me... I gave you wrong instructions how to hack the module. Sorry. This is how it should have read:

  1. Delete the lines 1475 - 1488 in relatedcontent.module.
  2. Copy lines 43-114 of relatedcontent.mysql.inc and paste them at the end of relatedcontent.module.

These instructions are valid for version 5.x-1.6 of relatedcontent.module.

#5

thomas74 - March 25, 2008 - 22:01
Status:active» closed

Yes, that what I thought. I'm not a php-expert, but functions within functions looked strange to me :-)

Anyway, this fixed my problem.
I'm still not there however. I just noticed that for some reason my theme - multiflex37 - doesn't show any menu-items under tabs. For example, when I go to the tab relatedcontent in a node it doesn't show the items Overview l view_1 l view_2 etc. I know how to get there by typing the url, but it's still anoying. So I'm gonna look what's wrong with my theme now.

Thanx for helping me out!

 
 

Drupal is a registered trademark of Dries Buytaert.