Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: $CONIG is NULL in functioins.inc.php  (Read 3640 times)

0 Members and 1 Guest are viewing this topic.

ltiefland

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
$CONIG is NULL in functioins.inc.php
« on: August 12, 2009, 11:48:48 am »

Hi all,

that's really strange.

On http://www.charlys-bummelzug.de/galerie we have installed coppermine 1.4.10. On the old server erverything was fine and since it has moved to a new server I only get "Unable to connect to database!".
Even with the newest version (http://www.charlys-bummelzug.de/cpg14x/) it does NOT work.

I have traced the problem to the functions.inc.php file. The command "global $CONFIG" somehow does NOT work. The variable is NULL, therefore there is no info for the DB connection.

What's going on?
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: $CONIG is NULL in functioins.inc.php
« Reply #1 on: August 12, 2009, 12:59:01 pm »

Your settings for the new server + db need to be entered into file:   include/config.inc.php

This value (imo) just doesn't look to be correct    user 'www-data'@'localhost'

Make sure that your final version is cpg1.4.25 when you are finished.

ltiefland

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: $CONIG is NULL in functioins.inc.php
« Reply #2 on: August 12, 2009, 01:03:32 pm »

Hi,

that was also my first thought. But when I insert "var_dump($CONFIG);" into the cpg_db_connect() function the output is: NULL

In "init.inc.php" just before the call to the cpg_db_connect() function everything is fine.

Also: An other script using the same connect information works without any problems.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $CONIG is NULL in functioins.inc.php
« Reply #3 on: August 12, 2009, 01:30:06 pm »

On http://www.charlys-bummelzug.de/galerie we have installed coppermine 1.4.10.
We will not look into issues that may or may not be related to using outdated versions. The only supported version is the most recent stable release (currently cpg1.4.25). The fact that you installed it another time on the same server makes no difference. Upgrade!

On the old server erverything was fine and since it has moved to a new server I only get "Unable to connect to database!".
We can't help you with your webserver setup. If you're convinced that the data in http://www.charlys-bummelzug.de/galerie/include/config.inc.php is correct, ask your webhost for support. Don't allow them to answer like "third party software goes unsupported" - although Coppermine is third party software from their perspective, you appear to be on the right track: the global command from PHP needs to work no matter what. You could try the attached test script as well:
Code: [Select]
<?php
$CONFIG 
= array();
$CONFIG['foo'] = 'bar';
echo 
test_global_scope();
function 
test_global_scope() {
    global 
$CONFIG;
    if (
$CONFIG['foo'] == 'bar') {
        echo 
'The global command appears to work as expected';
    } else {
        echo 
'The global command doesn\'t seem to work as expected - the content of the array $CONFIG is:';
        echo 
'<pre>';
        
print_r($CONFIG);
        echo 
'</pre>';
    }
}
?>
Logged

Nibbler

  • Guest
Re: $CONIG is NULL in functioins.inc.php
« Reply #4 on: August 12, 2009, 01:49:07 pm »

I doubt that's the issue.

Check for an .htaccess file in your web root that's intercepting requests for php scripts.
Logged

ltiefland

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: $CONIG is NULL in functioins.inc.php
« Reply #5 on: August 12, 2009, 02:08:27 pm »

Hi,

Thanks for your help. At first your test script made no output at all. Which was very strange.

After a little searching in the file system I stumbled over a .htaccess file in the root-folder that created the problem in the first place.

After commenting out the lines in that file, everything is fine now.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $CONIG is NULL in functioins.inc.php
« Reply #6 on: August 12, 2009, 04:01:15 pm »

Thanks for resolving your thread, and well done on the update.
Could you please (for the benefit of others with similar issues) post the lines from the .htaccess file that you commented out to make your gallery operational again?
I'm a bit concerned that what happened to you was part of a hacking attempt (caused by your reluctance to upgrade in the past), so I'd like to see what caused the issues. In case that this was actually caused by hacking, an upgrade is not enough to be save - you'd have to sanitize your gallery as suggested in the Yikes thread. I recommend to sanitize anyway to be sure.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.