4.2.5 Database error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HZG
    New Member
    • Feb 2014
    • 6
    • 4.2.X

    4.2.5 Database error

    Yesterday I decided to upgrade to 4.2.5 from 4.2.4 due to the final release. Upon updating I found that my forum works fine with PHP 5.6, but gives out a database error on PHP 7 (without any details as to what the error is, it also didn't write anything to the error.log). So for now I've reverted back to PHP 5.6 and left the forum running on that, but I would like to make use of the performance advantages PHP 7 offers.

    I've tried disabling the Plugin/Hook System to make sure it wasn't any of my plugins, but that didn't seem to make any difference. I've also tried running it on both PHP 7 and 7.1, but both continue giving out a database error.

    Anyone have any idea how I can fix this?
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74132

    #2
    Originally posted by HZG
    Anyone have any idea how I can fix this?
    No... We would need to know what error is occuring. Put the site in debug mode. Is more information shown?

    Add this line to your config.php file to turn on debug mode:
    Code:
    $config['debug'] = true;
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • Alshalan
      Member
      • Apr 2017
      • 76
      • 4.2.x

      #3
      on config change this
      Code:
      $config['MasterServer']['username'] = 'root';
      $config['MasterServer']['password'] = '[COLOR=#FF0000]xxx'[/COLOR];
      to

      Code:
      $config['MasterServer']['username'] = 'root';
      [B]$config['MasterServer']['password'] = '';[/B]

      Comment


      • Wayne Luke
        Wayne Luke commented
        Editing a comment
        This reply doesn't seem relevant to the issue at hand. The change referred to will just create more errors unless you're running a horribly insecure MySQL server.
    • HZG
      New Member
      • Feb 2014
      • 6
      • 4.2.X

      #4
      Originally posted by Wayne Luke

      No... We would need to know what error is occuring. Put the site in debug mode. Is more information shown?

      Add this line to your config.php file to turn on debug mode:
      Code:
      $config['debug'] = true;
      Tried that and it did not give more information. Just the standard vBulletin "Database error" page.

      Originally posted by Alshalan
      on config change this
      Code:
      $config['MasterServer']['username'] = 'root';
      $config['MasterServer']['password'] = '[COLOR=#FF0000]xxx'[/COLOR];
      to

      Code:
      $config['MasterServer']['username'] = 'root';
      [B]$config['MasterServer']['password'] = '';[/B]
      Why would I remove the password? Then it won't be able to access the database at all.

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 74132

        #5
        Don't see an error when I visit your site. Does it only happen on specific pages?
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment

        • HZG
          New Member
          • Feb 2014
          • 6
          • 4.2.X

          #6
          Originally posted by Wayne Luke
          Don't see an error when I visit your site. Does it only happen on specific pages?
          That is because, as stated in the original post, I reverted to PHP 5.6 instead of PHP 7. It works fine on 5.6, just not on 7.

          Comment

          • Mark.B
            vBulletin Support
            • Feb 2004
            • 24287
            • 6.0.X

            #7
            Without knowing what the database error is, we have no way of resolving the issue.
            Database errors will be in the server logs somewhere. You will need to ask your host.

            If you set the technical email address in the config.php file, any future database errors should be emailed to you.
            MARK.B
            vBulletin Support
            ------------
            My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
            My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

            Comment

            • HZG
              New Member
              • Feb 2014
              • 6
              • 4.2.X

              #8
              Originally posted by Mark.B
              Without knowing what the database error is, we have no way of resolving the issue.
              Database errors will be in the server logs somewhere. You will need to ask your host.

              If you set the technical email address in the config.php file, any future database errors should be emailed to you.
              Just gave that a shot and it gave me the following information:

              Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME'
              *REMOVED FOR SECURITY REASONS*/forums/includes/class_core.php on line 6153

              Stack Trace:

              #0 vB_Database->halt() called in [path]/includes/class_core.php on line 5948
              #1 catch_db_error() called in [path]/includes/class_core.php on line 6153
              #2 vbulletin_exception_handler() called in on line

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 74132

                #9
                Originally posted by HZG

                That is because, as stated in the original post, I reverted to PHP 5.6 instead of PHP 7. It works fine on 5.6, just not on 7.
                I would suspect the error is in some plugin then. I have no problems running 4.2.5 on PHP 7.X. However, I also have no third-party plugins or addons installed either.

                Originally posted by HZG

                Just gave that a shot and it gave me the following information:

                Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME'
                *REMOVED FOR SECURITY REASONS*/forums/includes/class_core.php on line 6153

                Stack Trace:

                #0 vB_Database->halt() called in [path]/includes/class_core.php on line 5948
                #1 catch_db_error() called in [path]/includes/class_core.php on line 6153
                #2 vbulletin_exception_handler() called in on line
                Someone else had the same error... It was caused by a third-party plugin.
                Hi all, I have upgraded from 4.2.4 to 4.2.5 and it seems to be working but get this database error whenever I log into the admincp: Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME'


                If you have that plugin installed, then you will want to uninstall it until it is compliant with PHP 7.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment

                • HZG
                  New Member
                  • Feb 2014
                  • 6
                  • 4.2.X

                  #10
                  Originally posted by Wayne Luke

                  I would suspect the error is in some plugin then. I have no problems running 4.2.5 on PHP 7.X. However, I also have no third-party plugins or addons installed either.



                  Someone else had the same error... It was caused by a third-party plugin.
                  Hi all, I have upgraded from 4.2.4 to 4.2.5 and it seems to be working but get this database error whenever I log into the admincp: Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME'


                  If you have that plugin installed, then you will want to uninstall it until it is compliant with PHP 7.
                  I've previously already tried disabling all the plugins, but that didn't seem the trick.The error continues to exist on PHP 7.

                  Comment

                  • Paul M
                    Former Lead Developer
                    vB.Com & vB.Org
                    • Sep 2004
                    • 9886

                    #11
                    What error exactly are you referring to, as this thread is very confusing.
                    Baby, I was born this way

                    Comment

                    • HZG
                      New Member
                      • Feb 2014
                      • 6
                      • 4.2.X

                      #12
                      Originally posted by Paul M
                      What error exactly are you referring to, as this thread is very confusing.
                      It displays the standard vBulletin "Database error" page. I stated that in an earlier post as well.

                      What is confusing about it? I can clarify any details necessary to help remove any confusion.

                      Comment

                      • Paul M
                        Former Lead Developer
                        vB.Com & vB.Org
                        • Sep 2004
                        • 9886

                        #13
                        What error is e-mailed to you ?

                        In debug mode, what details are shown (if necessary, right click, and view the source).
                        Baby, I was born this way

                        Comment

                        Related Topics

                        Collapse

                        Working...