Support » Installing WordPress » Error installing WordPress

  • I am trying to install WordPress on localhost on Windows 10 for testing before upload it to my hosting service. I first tried to use XAMPP to install everything, but had to remove it. Then, I installed Apache 2.4, MySQL 8, and PHP 7.4 individually.

    When I tried to run install.php I get the following message:
    “There has been a critical error on this website.”

    After investigation, it seems like wp-db.php is using mysql_connect() instead of the newer mysqli extensions.

    Apache indicates that the proper modules are installed, including php7_module.

    Here’s where the install.php seems to bomb:

    Stack trace:
    #0 C:\Apache24\htdocs\wptest\wp-includes\wp-db.php(724): wpdb->db_connect()
    #1 C:\Apache24\htdocs\wptest\wp-includes\load.php(561): wpdb->__construct('deleted', 'deleted', 'wptest', 'localhost')
    #2 C:\Apache24\htdocs\wptest\wp-settings.php(124): require_wp_db()
    #3 C:\Apache24\htdocs\wptest\wp-config.php(101): require_once('C:\\Apache24\\htd...')
    #4 C:\Apache24\htdocs\wptest\wp-load.php(50): require_once('C:\\Apache24\\htd...')
    #5 C:\Apache24\htdocs\wptest\wp-admin\install.php(36): require_once('C:\\Apache24\\htd...')
    #6 {main}
      thrown in C:\Apache24\htdocs\wptest\wp-includes\wp-db.php on line 1785

    ///

    I have installed WordPress 5.9, which should have the proper extensions, or so I believe. Regardless, it seems like my installation wants to use mysql_connect() instead of mysqli .

    Anyway, I am totally new to WordPress, and so it could be something quite simple. But regardless, I am stumped.

    Any help would be appreciated.

    Bob Frankenhoff

    The page I need help with: [log in to see the link]

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter rfrankenhoff

    (@rfrankenhoff)

    Maybe that (Named Pipes) is the problem. When I re-installed MySQL, I put a check mark on “Named Pipes.” I thought it might be handy, since Windows also supports named pipes–or, I thought it did?

    Anyway, I’ll try to either disable that feature–or re-install MySQL if necessary. I’ll let you know if that does it. It will probably be tomorrow before I do that.

    Thanks,

    Bob F

    Thread Starter rfrankenhoff

    (@rfrankenhoff)

    I re-installed MySQL with named_pipe = OFF.

    Still no luck.

    I downloaded a PHP script that checks the MySQL database mysqli_select_db() and it works–I am able to query the database. So, I don’t think MySQL is the problem.

    I also re-installed WordPress, just to be sure.

    I do believe that the issue is that PHP.ini is not configured correctly. Either that, or I’m missing some software related to PHP.

    There are a lot of options under the [MySQLi] header in PHP.ini, and I have to believe that the problem could be there.

    Also, what about mysqlnd? Remember, I’m on a Windows 10 computer.

    Here’s what mine looks like:

    [MySQLi]

    ; Maximum number of persistent links. -1 means no limit.
    ; http://php.net/mysqli.max-persistent
    mysqli.max_persistent = -1

    ; Allow accessing, from PHP’s perspective, local files with LOAD DATA statements
    ; http://php.net/mysqli.allow_local_infile
    ;mysqli.allow_local_infile = On

    ; Allow or prevent persistent links.
    ; http://php.net/mysqli.allow-persistent
    mysqli.allow_persistent = On

    ; Maximum number of links. -1 means no limit.
    ; http://php.net/mysqli.max-links
    mysqli.max_links = -1

    ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
    ; at MYSQL_PORT.
    ; http://php.net/mysqli.default-port
    mysqli.default_port = 3306

    ; Default socket name for local MySQL connects. If empty, uses the built-in
    ; MySQL defaults.
    ; http://php.net/mysqli.default-socket
    mysqli.default_socket =

    ; Default host for mysqli_connect() (doesn’t apply in safe mode).
    ; http://php.net/mysqli.default-host
    mysqli.default_host =

    ; Default user for mysqli_connect() (doesn’t apply in safe mode).
    ; http://php.net/mysqli.default-user
    mysqli.default_user =

    ; Default password for mysqli_connect() (doesn’t apply in safe mode).
    ; Note that this is generally a *bad* idea to store passwords in this file.
    ; *Any* user with PHP access can run ‘echo get_cfg_var(“mysqli.default_pw”)
    ; and reveal this password! And of course, any users with read access to this
    ; file will be able to reveal the password as well.
    ; http://php.net/mysqli.default-pw
    mysqli.default_pw =

    ; Allow or prevent reconnect
    mysqli.reconnect = Off

    [mysqlnd]
    ; Enable / Disable collection of general statistics by mysqlnd which can be
    ; used to tune and monitor MySQL operations.
    mysqlnd.collect_statistics = On

    ; Enable / Disable collection of memory usage statistics by mysqlnd which can be
    ; used to tune and monitor MySQL operations.
    mysqlnd.collect_memory_statistics = Off

    ; Records communication from all extensions using mysqlnd to the specified log
    ; file.
    ; http://php.net/mysqlnd.debug
    ;mysqlnd.debug =

    ; Defines which queries will be logged.
    ;mysqlnd.log_mask = 0

    ; Default size of the mysqlnd memory pool, which is used by result sets.
    ;mysqlnd.mempool_default_size = 16000

    ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
    ;mysqlnd.net_cmd_buffer_size = 2048

    ; Size of a pre-allocated buffer used for reading data sent by the server in
    ; bytes.
    ;mysqlnd.net_read_buffer_size = 32768

    ; Timeout for network requests in seconds.
    ;mysqlnd.net_read_timeout = 31536000

    ; SHA-256 Authentication Plugin related. File with the MySQL server public RSA
    ; key.
    ;mysqlnd.sha256_server_public_key =

    Thanks,

    Bob F

    Dion

    (@diondesigns)

    If php.ini was configured incorrectly, then your test script would have failed as well.

    What value did you use for hostname in the test script? Does it match the value of DB_HOST in your wp-config.php file? Did your test script use the same DB user/password that is specified in your wp-config.php file?

    Thread Starter rfrankenhoff

    (@rfrankenhoff)

    Well I did verify that /php74/php.ini is being used by my test script.

    How about .htaccess? I don’t have an htaccess file under my htdocs directory.

    See below:

    ;;;;;;;;;;;;;;;;;;;;
    ; php.ini Options  ;
    ;;;;;;;;;;;;;;;;;;;;
    ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
    ;user_ini.filename = ".user.ini"

    I’m puzzled as to why wp-db.php is still using mysql_connect() instead of mysqli_connect(). Mysql_connect() was no longer available in PHP since PHP7.

    Bob F.

    Thread Starter rfrankenhoff

    (@rfrankenhoff)

    Well, I think I’ve found the problem. I had cut and pasted the PHPIniDir in httpd.conf from someone’s recommendation, and I had placed double-quotes around “C:/php74” . Apparently, the quotes should not be there.

    So now, I am able to see the install.php screen. I am still having some other issues, but I believe that they are related to the fact that I have empty tables in the WordPress database.

    Thanks for your help. I am hoping that I can get the rest of the problems ironed out myself.

    Thanks,

    Bob F.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Error installing WordPress’ is closed to new replies.