Gossamer Forum
Home : Products : Gossamer Links : Discussions :

moved to new server, database.def file not readable

Quote Reply
moved to new server, database.def file not readable
I moved my Links SQL 2.x installation over to a new server (cPanel to cPanel migration), and I'm getting the following error message when trying to view the site:

Configuration file, /.../cgi-bin/links/admin/defs/database.def, is not readable.

I tried 0644, 0666, 0755, and, 0777 permissions on the file, but no change. (It's been so long since I installed it, I can't remember if there's anywhere that says what to manually set permissions to. The manual I have doesn't seem to mention anything.)

I did find this thread:

http://www.gossamer-threads.com/forum/Products_C9/Gossamer_Links_C5/Discussions_F18/Re%3A_%5Bdbode%5D_Which_DBD_do_I_have_to_install_%3F_P228997/?search_string=database.def%2C%20is%20not%20readable#p228997

But resyncing the Category properties has no effect on the database.def file. Is there any way to get at that one with a resync?

All the database connectivity appears to be fine in the admin panel...

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
Are all your paths ok? Try doing a grep in SSH for the OLD path:

Code:
grep -r -l '/path/to/old/admin' .

Do you see any results? If so, those need replacing with the new path. Not sure if thats your issue, but its worth checking (with a server move, you have to be sure to change ALL the paths... normally its easier to create a SQL dump, copy those files over - run a "grep" to replace all instances of the path, and finally re-import the DB)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] moved to new server, database.def file not readable In reply to
Hi Dan,

Andy is right. Also it's worth to check directory permissions, that may cause the issue as well.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
The server paths are identical on both servers. I'm pretty sure it is a file or directory permissions issue ... that's the question, what should the permissions be? I can't find anything saying what to manually set them to.

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
Hi Dan,

The the dir permissions should be 0755 so they can be executable and readable by the web server (all of them, not only the defs dir).

Btw if you enable debugging is there more details in the web server error log?

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
Thanks, that was the missing piece. I went through and set permissions on all the directories, as well, but include() failures still to investigate now that the initial error is taken care of.

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
What's the error?

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
Warning: include(home.html) [function.include]: failed to open stream: No such file or directory in /.../cgi-bin/links/admin/Links/PHP/Links.inc.php on line 238

Warning: include(home.html) [function.include]: failed to open stream: No such file or directory in /.../cgi-bin/links/admin/Links/PHP/Links.inc.php on line 238

Warning: include() [function.include]: Failed opening 'home.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /...l/cgi-bin/links/admin/Links/PHP/Links.inc.php on line 238

---

Seems to be an issue with include("$_file.html"); not including the path; I'm trying to trace down where that problem is occurring.

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
Hi Dan,

Seems your PHP environment (include_path) is not set properly it misses the path to the templates directory.

It should contain the path to the $template_set directory and $template_set/local dir as well.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins

Last edited by:

eupos: Jul 20, 2012, 8:37 AM
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
I'm not following how/where the template path is specified. To enter that block of code, it has to pass this check:

if (file_exists_readable("$admin_root_path/templates/${template_set}_php/$_file.html") or file_exists_readable("$admin_root_path/templates/${template_set}_php/local/$_file.html")) {

The path and template set are both specified in those lookups. But the template itself is included via:

include("$_file.html");

How is include() being told what directory to look in for home.html?

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
MMm surely include("$_file.html"); should have a path in it, not just the filename? (unless it does a "chdir" or PHP version somewhere)

I'm afraid my PHP is a bit rusty Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
Hi Dan,

include_path is set on line 219 in Links.inc.php

Code:
ini_set('include_path', "$admin_root_path/templates/${template_set}_php/local$_delimiter$admin_root_path/templates/${template_set}_php");

For some reason it seems ini_set function doesn't do it's job :\

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
Surely thats not right?

Code:
ini_set('include_path', "$admin_root_path/templates/${template_set}_php/local$_delimiter$admin_root_path/templates/${template_set}_php");

Notice the duplicated paths? :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] moved to new server, database.def file not readable In reply to
The paths are fine Andy, they are separated by $_delimiter (: or ;) that's how they are defined in $ENV.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
Aaah ok - was wondering what that was =) (I havn't used/written PHP in over 10 years - and I expect a lot has changed since then ;))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [eupos] moved to new server, database.def file not readable In reply to
eupos wrote:
Hi Dan,

include_path is set on line 219 in Links.inc.php

Aha, thanks! I'm looking into it... Probably just a security tweak on the new server.

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
Support is looking into it, but in the meantime I solved the problem by switching from ini_set() to set_include_path().

Thanks for pointing me in the right direction!

Dan
Quote Reply
Re: [Dan Kaplan] moved to new server, database.def file not readable In reply to
Cool Smile

Glad that helped to solve the problem Wink

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins