PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Script Installation

Reply
 
Thread Tools
Old 01-21-2004, 07:33 AM   #1
rafarspd
Orange Mole
 
rafarspd's Avatar
 
Join Date: Nov 2003
Location: High Wycombe, Bucks. UK
Posts: 35
Updated to 1.8.0 - unable to connect to database

It say's - check the configuration script.
-------------------------------------------------

in \admin\index.php is:

Header('Pragma: no-cache');
$relative_script_path = '..';
include "$relative_script_path/includes/config.php";
include "$relative_script_path/libs/auth.php";

The instructions for relative script path say:-
The $relative_script_path must contain the relative path of PhpDig's root directory from the current script.

so the path is .. [the directory below \admin].

Have I understood it so far!
-----------------------------------

In \includes\config.php we have the additional lines of:

if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..")) {
exit();
}
if (eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {
exit();
}

Surely this is saying that if the relative_script_path is .. then exit with error message.

Perhaps I definately do not understand that!
--------------------------------------------------------

So PhpDig is now dead unless You can help - otherwise the only way to get things working is to go back to the previous version.

p.s. The Database connection information has been entered correctly and double checked.

ttfn
nnnn
__________________
Regards
Bob Finch
rafarspd is offline   Reply With Quote
Old 01-21-2004, 10:25 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. PhpDig version 1.8.0 already has the following code in the config file:
PHP Code:
if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..")) {
  exit();
}
if (
eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {
  exit();

The code that gives the "Unable to connect to database : Check the connection script" errror is the following:
PHP Code:
// Connection configuration
define('PHPDIG_DB_PREFIX','<dbprefix>');
define('PHPDIG_DB_HOST','<host>');
define('PHPDIG_DB_USER','<user>');
define('PHPDIG_DB_PASS','<pass>');
define('PHPDIG_DB_NAME','<database>');

//connection to the MySql server
$id_connect = @mysql_connect(PHPDIG_DB_HOST,PHPDIG_DB_USER,PHPDIG_DB_PASS);
if (!
$id_connect) {
    die(
"Unable to connect to database : Check the connection script.\n");

Try calling the PhpDig version 1.8.0 connect.php file from the browser. If it throws the "Unable to connect to database : Check the connection script" error, then that means that the database variables are not properly configured.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 01-22-2004, 04:39 AM   #3
rafarspd
Orange Mole
 
rafarspd's Avatar
 
Join Date: Nov 2003
Location: High Wycombe, Bucks. UK
Posts: 35
Hi Charter

Please accept my apologies for bothering you with a problem which was due entirely to my brain not functioning correctly.

I would never have thought of calling the connect.php direct from the browser, it confirmed that the database variables were not set correctly.

To clarify, they were set correctly but when I entered the data I did not remove the '<' and '>'. What an idiot!

My best regards to you and sorry to hear about the troubles.
Is there anything I can do to help.
__________________
Regards
Bob Finch
rafarspd is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't connect to Database liquidice Script Installation 16 01-17-2005 12:17 AM
connect.php search4lancer Script Installation 1 07-20-2004 10:44 PM
Unable to connect to database : Check the connection script. marb Troubleshooting 5 04-12-2004 03:35 AM
Unable to connect to database : Check the connection script. Nosmada Troubleshooting 2 02-27-2004 09:15 AM
Unable to connect to database : Check the connection script. Wayne McBryde Script Installation 7 11-04-2003 12:08 PM


All times are GMT -8. The time now is 03:51 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.