How to edit the first config.php file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Byron Z.
    New Member
    • Nov 2010
    • 9

    How to edit the first config.php file

    I am installing VB5, but found there are config.php files, I edited the one with database, but don't know how edit the front end one, especially where to add the URL information, please help!

    <?php

    class vB5_Config
    {

    private static $instance;
    private static $defaults = array(
    'no_template_notices' => false,
    'debug' => false,
    'report_all_php_errors' => true,
    'collapsed' => true,
    'no_js_bundles' => false,
    'render_debug' => false,
    );
    private $config = array();


    public static function instance()
    {
    if (!isset(self::$instance))
    {
    $c = __CLASS__;
    self::$instance = new $c;
    }

    return self::$instance;
    }

    /**
    *
    * @param string $file
    */
    public function loadConfigFile($file)
    {
    if (is_link(dirname($_SERVER["SCRIPT_FILENAME"])))
    {

    $frontendConfigPath = dirname(dirname(dirname($_SERVER["SCRIPT_FILENAME"]))) . '/' . $file;
    }
    else
    {
    $frontendConfigPath = dirname(__FILE__) . '/../../' . $file;
    }
    require_once($frontendConfigPath);
    if (!isset($config))
    {
    die("Couldn't read config file $file");
    }

    $this->config = array_merge(self::$defaults, $config);
    }

    public function __get($name)
    {
    if (isset($this->config[$name]))
    {
    return $this->config[$name];
    }
    else
    {
    $trace = debug_backtrace();
    trigger_error("Undefined config property '$name' in " .
    $trace[0]['file'] . ' on line ' .
    $trace[0]['line'], E_USER_NOTICE);
    return null;
    }
    }

    }
  • TLMD
    Senior Member
    • Sep 2012
    • 1766
    • 5.6.X

    #2
    vB5 has 2 config files that need your attention:

    The first one is in the root directory. This one usually does not need any edits despite renaming it to config.php.

    The second one is located in the /core/includes directory. This one needs at least your database information to make vB5 work correctly. After having entered the required information, make sure you also rename this file to config.php.

    Comment

    • Byron Z.
      New Member
      • Nov 2010
      • 9

      #3
      Installing vBulletin 5 Connect

      1. vBulletin 5 has two config.php files. It is very important that both are edited and the values of any overlapping variables like cookie prefix are identical in both files.

      The second one is located in the /core/includes directory. This one needs at least your database information to make vB5 work correctly. After having entered the required information, make sure you also rename this file to config.php.

      Then where is the first one? Is config.php.bkp the first one to be changed into config.php, then how to edit?

      2. vBulletin 5 Requires URL Rewriting. This will be mod_rewrite or its equivalent under Apache and URL Rewrite under IIS. There is an .htaccess (Apache) file and web.config (IIS) included in the upload folder for this purpose. The software will not work without URL Rewriting.

      Could you please tell how to rewrite these two files? How to go there and show me an example please.

      Thanks in advance.



      Comment

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

        #4
        The code in the first post is not from a file you should be editing. As of vBulletin 5.0.4, the only file you should be editing is upload/core/includes/config.php.new

        Rename it config.php.

        Edit it.

        You need to update the following values in your config.php to make a connection with the database:

        $config['Database']['dbname'] = 'XXXX';
        $config['MasterServer']['servername'] = '127.0.0.1';
        $config['MasterServer']['port'] = 3306;
        $config['MasterServer']['username'] = 'YYYY';
        $config['MasterServer']['password'] = 'ZZZZ';

        Replace XXXX with your database name.
        Replace 127.0.0.1 with your servername. If you're on a linux server you can change it to localhost if you want.
        Change 3306 with the port number that your hosting company provides, if any. Otherwise leave it alone.
        Replace YYYY with your database user name.
        Replace ZZZZ with your database user password.

        All of this information can be obtained from your hosting provider.

        If your want better performance and your server supports it, change the following to mysqli:
        $config['Database']['dbtype'] = 'mysql';

        To be notified about potential issues with your database update the following with your email:
        $config['Database']['technicalemail'] = '[email protected]';

        You will also need to rename upload/config.php.bkp to config.php but you do not need to edit the file.
        Translations provided by Google.

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

        Comment

        • Byron Z.
          New Member
          • Nov 2010
          • 9

          #5
          Thank you Wayne:

          I think I did this already, anyway I am going to try from the very beginning. Then tell you the result.

          Comment

          • Byron Z.
            New Member
            • Nov 2010
            • 9

            #6
            One more question attention please:

            In upload/core/includes, except the config.php.new file, there is another one called config_cli.php.new, shall we change the file to config_cli.php and editor it?

            Waiting for your help to try new


            Comment

            • TLMD
              Senior Member
              • Sep 2012
              • 1766
              • 5.6.X

              #7
              Originally posted by Byron Z.
              In upload/core/includes, except the config.php.new file, there is another one called config_cli.php.new, shall we change the file to config_cli.php and editor it?
              That is not necessary for the installation of vB.

              Comment

              Related Topics

              Collapse

              Working...