Title: Error installing WordPress
Last modified: March 11, 2022

---

# Error installing WordPress

 *  [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-installing-wordpress-9%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/error-installing-wordpress-9/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-installing-wordpress-9/page/2/?output_format=md)

 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450736)
 * `wp-includes\load.php(561): wpdb->__construct('deleted', 'deleted', 'wptest','
   localhost')`
 * Can you confirm that your DB username and password values are `deleted`?
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450756)
 * Yes,
 * I deleted them for security reasons.
 * Bob F
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450761)
 * I deleted them before I sent them to you.
 * Bob F
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450765)
 * Ok, I understand that you replaced the username and password with `deleted` in
   the error message.
 * Can you try `127.0.0.1` as the hostname instead of `localhost` and see if that
   works for you?
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450778)
 * Same result:
 * And the error log again:
    [11-Mar-2022 18:43:08 UTC] PHP Fatal error: Uncaught
   Error: Call to undefined function mysql_connect() in C:\Apache24\htdocs\wptest\
   wp-includes\wp-db.php:1785 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 again’, ‘deleted again’, ‘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
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450787)
 * Updated: Please check your php.ini and make sure `mysqli` extensions are loading.
    -  This reply was modified 4 years, 2 months ago by [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/).
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450826)
 * Sorry,
 * I only used 127.0.0.1 on my browser. Here it is again with changes in wp-config.
   php:
 *     ```
       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('del', 'del', 'wptest', '127.0.0.1')
       #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
       ```
   
 * Php.ini is a big file. What exactly am I looking for?
 * Bob F
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450830)
 * Look for lines
 *     ```
       extension_dir="ext"
       extension=mysql
       extension=mysqli
       ```
   
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450865)
 * To know, you can also use [https://localwp.com/](https://localwp.com/) if you’re
   not comfortable setting & fixing all these environment things manually.
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450924)
 * Well, I uncommented
 * extension_dir = “ext”
    extension=mysql extension=mysqli
 * Still doesn’t work.
 * Do I need to re-start httpd.exe? (I did.)
 * You also mentioned absolute paths to these modules. I’m sure I have added additional
   folders (e.g. wptest/).
 * However, you also mentioned [https://localwp.com/](https://localwp.com/) .
 * I have worked with the environment in Windows 10, but it is new to me and for
   some things I prefer Linux.
 * Bob F
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15450935)
 * Also, any concerns regarding caching?
 * Bob F
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15451237)
 * It sounds like you’re not loading the PHP `mysqlnd` extension. Without `mysqlnd`,
   the `mysqli` extension will not recognize the new authentication plugins used
   by MySQL8.
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15451287)
 * Regarding mysqlnd, I do not seem to see a file with that name anywhere, e.g. 
   php_mysqlmd.dll or similar. Is that a part of the PHP extensions–should it be
   in the ext directory of PHP? If not, where might I find it?
 * Thanks,
 * Bob F
 *  Thread Starter [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * (@rfrankenhoff)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15451308)
 * Also, I did install MySQL myself. I tried setting up a server with XAMPP, but
   nothing worked correctly other than MySQL. Perhaps I did not install MySQL with
   the correct options??? I did remove it and re-install it.
 * Bob F
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/#post-15451473)
 * Sorry about that…I completely missed the Windows 10 statement in your first post.
   Windows builds of PHP from windows.php.net have `mysqlnd` compiled into the `
   php_mysqli.dll` file.
 * Windows builds of PHP do not support named pipes, so make sure you configure 
   MySQL to use TCP (`skip-networking` and `enable-named-pipe` must be disabled!),
   and then use 127.0.0.1 for the hostname. You might also want to read this:
 * [https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password)

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/error-installing-wordpress-9/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-installing-wordpress-9/page/2/?output_format=md)

The topic ‘Error installing WordPress’ is closed to new replies.

## Tags

 * [install.php](https://wordpress.org/support/topic-tag/install-php/)
 * [php74](https://wordpress.org/support/topic-tag/php74/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 20 replies
 * 4 participants
 * Last reply from: [rfrankenhoff](https://wordpress.org/support/users/rfrankenhoff/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/error-installing-wordpress-9/page/2/#post-15453110)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
