Title: wp-db.php-error
Last modified: August 19, 2016

---

# wp-db.php-error

 *  Resolved [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * (@rebeccadewinter)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/)
 * Hi.
    First usage of [http://domain/wp-admin/install.php](http://domain/wp-admin/install.php)
   results in following error:
 * “Fatal error: Call to undefined function preg_match() in /usr/home/domain/htdocs/
   wp-includes/wp-db.php on line 288”
 * I could not find any solution to this.
    FreeBSD 6.2 MySQL version 4.1.22 PHP 
   Version 5.2.4
 * Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779789)
 * That almost seems like PHP is not correctly configured.
 * Also, my line 288 in wp-db.php does NOT have the function preg_match though that
   function is on line 287.
 * Check with your host. Also make sure you have a good set of WordPress files uploaded–
   even if you have to delete and reupload.
 * [Uploading_WordPress_to_a_remote_host](http://codex.wordpress.org/Uploading_WordPress_to_a_remote_host)
 *  Thread Starter [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * (@rebeccadewinter)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779804)
 * This is my line 288:
    `if ( preg_match("/^\\s*(insert|delete|update|replace) /
   i",$query) ) {`
 * Furthermore:
    PHP is configured correctly as other scripts run without any errors.
   And: The files were uploaded for the first time- there is no re-upload. It is
   the German version, readme.html dated 26.4.2008 Any ideas?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779810)
 * Just downloaded the [http://de.wordpress.org/wordpress-2.5.1-de_DE.zip](http://de.wordpress.org/wordpress-2.5.1-de_DE.zip)
   verson and that line you are talking about is line 287, not 288, at least in 
   that distribution.
 *  Thread Starter [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * (@rebeccadewinter)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779834)
 * OK, I’ll download it again and make another try.
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779841)
 * Forgot to recommend that you are using ASCII mode when using FTP or automatic
   mode if using FileZilla.
 * [Uploading_WordPress_to_a_remote_host](http://codex.wordpress.org/Uploading_WordPress_to_a_remote_host)
 *  Thread Starter [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * (@rebeccadewinter)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779877)
 * Now:
    file you mentioned uploaded, result is different, well not really:
 * `Fatal error: Call to undefined function preg_match() in /usr/home/domain/htdocs/
   wp-includes/wp-db.php on line 287`
 * Files are uploaded in correct mode, did .PHP again manually in ASCII mode to 
   be really sure, result is the same.
    OK, maybe the bug is in the MySQL, therefor
   here is how the database was created:
 *     ```
       # mysql -u root
       Welcome to the MySQL monitor.  Commands end with ; or \g.
       Your MySQL connection id is 171 to server version: 4.1.22
   
       Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
   
       mysql> CREATE DATABASE wordpress;
       Query OK, 1 row affected (0.00 sec)
   
       mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "wordpress"@"localhost"
           -> IDENTIFIED BY "password";
       Query OK, 0 rows affected (0.04 sec)
       ```
   
 * Any idea?
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779881)
 * A guess, but I think your PHP5 install is not complete.
 * If you run “pkg_info | grep php5” and don’t see pcre in the listed output then
   try installing the FreeBSD 6.2 package for php5-pcre.
 * That should include the preg functions and get you past that error.
 *  Thread Starter [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * (@rebeccadewinter)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779889)
 * Output:
 * pkg_info | grep php5
    php5-5.2.4_1 PHP Scripting Language php5-mysql-5.2.4_1 
   The mysql shared extension for php php5-pcre-5.2.4_1 The pcre shared extension
   for php
 * …after having installed php5-pcre.
    Result is just the same:
 * `Fatal error: Call to undefined function preg_match() in /usr/home/domain/htdocs/
   wp-includes/wp-db.php on line 287`
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779958)
 * Well, that is as far as my FreeBSD experience goes I’m afraid.
 * You’re installation is definitely missing something but I’m out of ideas as to
   what that is.
 * Good luck.
 *  Thread Starter [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * (@rebeccadewinter)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779969)
 * Problem solved after rebooting the machine.
    Thanks for your help!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘wp-db.php-error’ is closed to new replies.

## Tags

 * [preg_match](https://wordpress.org/support/topic-tag/preg_match/)
 * [wp-db.php](https://wordpress.org/support/topic-tag/wp-db-php/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 10 replies
 * 3 participants
 * Last reply from: [rebeccadewinter](https://wordpress.org/support/users/rebeccadewinter/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/wp-dbphp-error/#post-779969)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
