Title: PHP7 &#8211; Call to undefined function mysql_connect()
Last modified: September 1, 2016

---

# PHP7 – Call to undefined function mysql_connect()

 *  Resolved [ZeroGravity](https://wordpress.org/support/users/zerogravity/)
 * (@zerogravity)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php7-call-to-undefined-function-mysql_connect/)
 * I updated my cPanel hosting to use PHP7. I now get a white screen and this error.
   `
   Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/
   xxxxxx/public_html/wp-includes/wp-db.php:1549` I gather it’s something to do 
   with mysql libraries/extensions. What should I have activated. These are the 
   options I have on the PHP selector page. The ones in bold are checked. What should
   I have checked/unchecked? (apologies for the formatting)
 * apcu imagick nd_mysqli **pspell** trader
    **bcmath** **imap** nd_pdo_mysql raphf
   uuid dba inotify oci8 redis wddx dbase intl opcache snmp xdebug **dom** **json****
   pdo** **soap** **xmlreader** eio ldap pdo_dblib **sockets** **xmlrpc** enchant
   lzf pdo_pgsql stats **xmlwriter** fileinfo mailparse **pdo_sqlite** sysvmsg **
   xsl** **gd** **mbstring** pgsql sysvsem yaml gender mcrypt **phar** sysvshm **
   zip** gmagick memcached **posix** **tidy** http **mysqlnd** propro timezonedb

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

 *  Thread Starter [ZeroGravity](https://wordpress.org/support/users/zerogravity/)
 * (@zerogravity)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php7-call-to-undefined-function-mysql_connect/#post-7676210)
 * Looks like I needed to activate nd_mysqli. Everything seems to be working now.
   Would this be correct? Is there anything else I should activate as well?
 * I didn’t see much of a performance increase but it is a fairly lightweight site.
 *  Moderator [Dion Hulse](https://wordpress.org/support/users/dd32/)
 * (@dd32)
 * Meta Developer
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php7-call-to-undefined-function-mysql_connect/#post-7676223)
 * Enabling the PHP7 OpCode Cache (`opcache`) will also provide some of the main
   speed boosts of PHP7, however enabling at least one `mysqli` extension was all
   you needed to do to get database connectivity back.
 * The only other one there which could be useful to you would be `mcrypt` which
   will allow PHP applications a wider range of encryption methods (although WordPress
   doesn’t leverage any of that under PHP7).
 *  Thread Starter [ZeroGravity](https://wordpress.org/support/users/zerogravity/)
 * (@zerogravity)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php7-call-to-undefined-function-mysql_connect/#post-7676334)
 * Thanks Dion!

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

The topic ‘PHP7 – Call to undefined function mysql_connect()’ is closed to new replies.

## Tags

 * [PHP7](https://wordpress.org/support/topic-tag/php7/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [ZeroGravity](https://wordpress.org/support/users/zerogravity/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/php7-call-to-undefined-function-mysql_connect/#post-7676334)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
