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: Error 500 populatemysqldb function failing  (Read 5339 times)

0 Members and 1 Guest are viewing this topic.

jmdoggett

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Error 500 populatemysqldb function failing
« on: April 13, 2013, 07:54:41 pm »

I've searched for the solution to this problem, thus my post. During installation I reach step 8, many of the tables are created in the database and then the installation script crashes.

The error log showed this:

13-Apr-2013 16:04:36 UTC] PHP Notice:  Undefined index: mysql_connected in D:\inetpub\wwwroot\coppermine\install.php on line 1592
[13-Apr-2013 16:04:36 UTC] PHP Notice:  Undefined index: temp_data in D:\inetpub\wwwroot\coppermine\install.php on line 1779
[13-Apr-2013 16:05:06 UTC] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in D:\inetpub\wwwroot\coppermine\install.php on line 1787

So I fixed the timeout in php.ini and that went message away. Any help would be appreciated.
Logged

jmdoggett

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Error 500 populatemysqldb function failing
« Reply #1 on: April 13, 2013, 09:28:31 pm »

Problem solved. I had to fix the function by creating a $temp_data variable at the top of the function, replace all the references to $GLOBALS['temp_data'] inside the for loop where the web page output is assembled and finally just above the return statement I added $GLOBALS['temp_data'] .= $temp_data;

Here is the relevant section:
    $temp_data .= '<tr><td>';
    foreach($sql_query as $q)
    {
        $is_table = false;
        //check if we are creating a table so we can add it to the output
        if (preg_match('/(CREATE TABLE IF NOT EXISTS `?|CREATE TABLE `?)([\w]*)`?/i', $q, $table_match))
        {
            $table = $table_match[2];
            $is_table = true;
        }
       
        if (! mysql_query($q, $GLOBALS['mysql_connection']))
        {
            $GLOBALS['error'] = $language['mysql_error'] . mysql_error($GLOBALS['mysql_connection'])
                . ' ' . $language['on_q'] . " '$q'";
               
            if ($is_table)
            {
                $temp_data .= "<br />" . sprintf($language['create_table'], $table)
                    . '&nbsp;&nbsp;&nbsp;&nbsp;' . $language['status'] . ':... ' . $language['nok'];
            }
            return false;
        }
        else
        {
            if ($is_table)
            {
                $temp_data .= "<br />" . sprintf($language['create_table'], $table)
                    . '&nbsp;&nbsp;&nbsp;&nbsp;' . $language['status'] . ':... ' . $language['ok'];
            }
        }
    }
   
    $GLOBALS['temp_data'] = $temp_data;

Cheers!
Jay
Logged
Pages: [1]   Go Up
 

Page created in 0.037 seconds with 21 queries.