Announcement

Collapse
No announcement yet.

"Use of undefined constant" error during installation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • cbiweb
    replied
    UPDATE: Installing locally as we speak. I didn't get cURL working, but for local testing I don't think I'll need it. And if I do, I'll deal with it when the time comes, lol.

    Thanks for the input, feedback and help! 👍

    Leave a comment:


  • cbiweb
    replied
    mysqli problem solved! In php.ini I had to change
    extension_dir = ext
    to
    extension_dir = "C:\web\php7\ext"

    Boom, vb_test.php works!

    Right now the only Fail is for cURL, which I'm trying to work out. It's not a case of entering the full path for that one, so I dunno.

    In any case, once I solve that, I will try installing vB again locally.

    whew.....

    Leave a comment:


  • cbiweb
    replied
    Originally posted by Wayne Luke View Post
    I am glad that you have one server working. Your local server may have the same issue. What happens when you try to log into the MySQL command line on the local server?
    I can log into that no problem. Both the command line and in Heidi (MariaDB's version of phpMyAdmin).

    Leave a comment:


  • cbiweb
    replied
    EDIT: Just saw your reply above after I finished typing and submitting this reply. I'll check what happens...

    ~

    Originally posted by Wayne Luke View Post
    Make sure that both mysqli and mysqlnd are enabled in the php.ini file
    They are.

    Originally posted by Wayne Luke View Post
    and show up in a web based phpinfo() output for your vBulletin directory.
    mysqlnd does, mysqli does not

    Originally posted by Wayne Luke View Post
    Depending on your server configuration it is possible to run different versions and configurations based on directory and web or CLI.
    It's a local setup, no fancy config for multiple versions of anything.

    Originally posted by Wayne Luke View Post
    With Windows, the MySQL DLLs are not included in the installer version of PHP. You must download a ZIP version from the PHP.net website to get all DLLs.
    ZIP version is what I downloaded. Never used the installer version in my life.

    Originally posted by Wayne Luke View Post
    The connection character set line (https://www.php.net/manual/en/phar.installation.php) should really only be uncommented if the installer tells you to do so.
    A bit confused on this one The link doesn't take me to a page that mentions the connection character set line. It's just a few lines about Phar. ...perhaps I'm misunderstanding something?

    Originally posted by Wayne Luke View Post
    If you are not using PHP 7.4 or higher...
    PHP 7.4.14

    Originally posted by Wayne Luke View Post
    Finally, make sure MySQL is listening to 127.0.0.1 or 0.0.0.0 if you want to allow remove connections. Most *nix installations come with a script to set this called mysql_secure_installation.
    It is listening to 127.0.0.1:80

    I managed to install 5.6.4 on the live server, but locally, running vb_test.php is still giving me this:

    Fatal error: Uncaught Error: Class 'mysqli' not found in C:\web\Apache24\htdocs\vB564\vb_test.php:39 Stack trace: #0 C:\web\Apache24\htdocs\vB564\vb_test.php(239): DB::fetch_db('localhost', 'root', '[myusername]', 'vb564test') #1 {main} thrown in C:\web\Apache24\htdocs\vB564\vb_test.php on line 39


    And of course I'm not going to try installing until that's fixed, because it's most likely the cause of the issue I posted about at the beginning of the thread.
    Last edited by cbiweb; Thu 14 Jan '21, 12:25pm.

    Leave a comment:


  • Wayne Luke
    replied
    I am glad that you have one server working. Your local server may have the same issue. What happens when you try to log into the MySQL command line on the local server?

    Leave a comment:


  • cbiweb
    replied
    This reply can be deleted. The secondary issue of not being able to install on the live server was fixed. The host requires at least one special character in my db password, and there was none.
    Last edited by cbiweb; Thu 14 Jan '21, 11:06am. Reason: Live server install issue figured out (original issue still unresolved)

    Leave a comment:


  • Wayne Luke
    replied
    Make sure that both mysqli and mysqlnd are enabled in the php.ini file and show up in a web based phpinfo() output for your vBulletin directory. Depending on your server configuration it is possible to run different versions and configurations based on directory and web or CLI.

    With Windows, the MySQL DLLs are not included in the installer version of PHP. You must download a ZIP version from the PHP.net website to get all DLLs.

    MySQLi is specifically a class in PHP, your my.cnf/ini file will not reference it at all. The MySQL INI entry is pretty worthless these days. This variable allowed PHP to override specific MySQL settings. It was useful back in the MySQL 4 days when MySQLi was new. Not so much anymore.

    Other Notes: Current versions of vBulletin 5 do not allow you to specify a database class. The only class is mysqli so the variable was removed from the /core/includes/config.php

    The connection character set line (https://www.php.net/manual/en/phar.installation.php) should really only be uncommented if the installer tells you to do so.

    If you are not using PHP 7.4 or higher, then you need to configure your database user to use the mysql_native_password encryption algorithm. Earlier versions of PHP do not support the newer SHA2 based algorithm. https://dev.mysql.com/doc/refman/8.0...ntication.html

    Finally, make sure MySQL is listening to 127.0.0.1 or 0.0.0.0 if you want to allow remove connections. Most *nix installations come with a script to set this called mysql_secure_installation.

    Leave a comment:


  • cbiweb
    replied
    Originally posted by In Omnibus View Post
    except Wayne Luke. I'm not sure if he sleeps.
    hahaha, I hear ya. I feel like ripping out my entire server setup and starting over with MySQL, but I dunno. I'll see what Wayne or anyone else might say. Since it's on my own local machine they can't actually look at my setup. I also may try installing on the remote server to see how it goes. If it installs, I'll just work on it there.

    Thanks for trying.

    Leave a comment:


  • In Omnibus
    replied
    Originally posted by cbiweb View Post

    Yeah I guess I copy/pasted the code before commenting it out. I tried it with a path, but no go. It is commented out now, and no change.

    I'm starting to wonder if it's because I'm running MariaDB? It is supposed to be totally compatible, being a MySQL clone but with some improvements. However. the MariaDB .ini contains only this:

    [mysqld]
    datadir=C:/Program Files/MariaDB 10.5/data
    port=3306
    innodb_buffer_pool_size=752M
    character-set-server=utf8
    [client]
    port=3306
    plugin-dir=C:/Program Files/MariaDB 10.5/lib/plugin


    No sign of mysqli. I might be barking up the wrong tree here, but maybe not?
    If you're using MariaDB you should comment out the MySQLi line so the script isn't looking for it. That's my first thought.

    The staff here are able to look at your setup or think of things out of the normal that might be at issue but they have to sleep some time ...

    except Wayne Luke. I'm not sure if he sleeps.

    Leave a comment:


  • cbiweb
    replied
    Originally posted by In Omnibus View Post
    The only other thing I see is in your code above the following line is uncommented but it lacks a path.

    $config['Mysqli']['ini_file'] = '';
    Yeah I guess I copy/pasted the code before commenting it out. I tried it with a path, but no go. It is commented out now, and no change.

    I'm starting to wonder if it's because I'm running MariaDB? It is supposed to be totally compatible, being a MySQL clone but with some improvements. However. the MariaDB .ini contains only this:

    [mysqld]
    datadir=C:/Program Files/MariaDB 10.5/data
    port=3306
    innodb_buffer_pool_size=752M
    character-set-server=utf8
    [client]
    port=3306
    plugin-dir=C:/Program Files/MariaDB 10.5/lib/plugin


    No sign of mysqli. I might be barking up the wrong tree here, but maybe not?

    Leave a comment:


  • In Omnibus
    replied
    The only other thing I see is in your code above the following line is uncommented but it lacks a path.

    $config['Mysqli']['ini_file'] = '';

    Leave a comment:


  • cbiweb
    replied
    Originally posted by In Omnibus View Post
    Do you have anything like NoScript that might be blocking the JS in the install script?
    Do you have cURL installed?
    No NoScript or other JS blockers, and it is enabled in my browser (Firefox)
    cURL is Installed and enabled in php.ini.

    btw, thank you for staying with me on this. Much appreciated. the answer is bound to come out eventually.


    EDIT: Okay, I just tried something. Created a file with <?php phpinfo(INFO_MODULES); ?> in it, ran it, and for some reason it mysqli isn't there. 😮 Yet it is enabled in php.ini. Is there somewhere else I need to check for this??
    Last edited by cbiweb; Thu 14 Jan '21, 4:02am.

    Leave a comment:


  • In Omnibus
    replied
    Do you have anything like NoScript that might be blocking the JS in the install script?

    Do you have cURL installed?

    Leave a comment:


  • cbiweb
    replied
    Originally posted by In Omnibus View Post
    And you have it set to mysqli in the config.php file?
    Far as I know... unless I need to enter the full path to the MySQL .ini file?

    // ****** MySQLI OPTIONS *****
    // When using MySQL 4.1+, MySQLi should be used to connect to the database.
    // If you need to set the default connection charset because your database
    // is using a charset other than latin1, you can set the charset here.
    // If you don't set the charset to be the same as your database, you
    // may receive collation errors. Ignore this setting unless you
    // are sure you need to use it.
    $config['Mysqli']['charset'] = 'utf8';

    // Optionally, PHP can be instructed to set connection parameters by
    // reading from the file named in 'ini_file'. Please use a full path to
    // the file.
    // Example:
    // $config['Mysqli']['ini_file'] = 'c:\program files\MySQL\MySQL Server 4.1\my.ini';
    $config['Mysqli']['ini_file'] = '';



    Originally posted by In Omnibus View Post
    Have you renamed the htaccess.txt file to .htaccess?
    Yes

    Originally posted by In Omnibus View Post

    Have you renamed the /includes/config.php.new file to config.php?
    Yes

    Leave a comment:


  • In Omnibus
    replied
    Originally posted by cbiweb View Post

    Weird, because I have MySQLi enabled in php.ini. Here's a snippet from the file:

    ;extension=ldap
    extension=mbstring
    ;extension=exif ; Must be after mbstring as it depends on it
    extension=mysqli
    ;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
    ;extension=odbc
    extension=openssl
    ;extension=pdo_firebird


    Totally unsure why I'm having such a hard time installing vB. lol
    And you have it set to mysqli in the config.php file?

    Have you renamed the htaccess.txt file to .htaccess?

    Have you renamed the /includes/config.php.new file to config.php?

    Leave a comment:

Related Topics

Collapse

  • cpai
    Error on Installation
    by cpai
    When I run the install.php script, I get the following error: Cannot declare self-referencing constant 'MYSQLI_NUM'

    Any ideas? I figure it's something in my MySQL install, but I come from...
    Fri 16 Nov '18, 5:36am
Working...
X