Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
PHP 7: Call to undefined function mysql_connect()
If you’re getting the following error when running the setup after installing Textpattern, your server has PHP version 7 (or higher) installed, which no longer has support for the old mysql extension (used by textpattern until at least version 4.5.7).
Checking database connection
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/textpattern-4.5.7/textpattern/setup/index.php:300
Stack trace:
- /var/www/html/textpattern-4.5.7/textpattern/setup/index.php(99): printConfig()
- {main} thrown in /var/www/html/textpattern-4.5.7/textpattern/setup/index.php on line 300
There are two ways to solve this:
- upgrade Textpattern to a more recent version (such as TXP 4.6), assuming it is available when you read this (recommended)
- ask your webhost to downgrade PHP to a version lower than 7 (not recommended)
Offline
Re: PHP 7: Call to undefined function mysql_connect()
Well, that’s convenient. Most hosts will likely be upgrading PHP sooner than later, not downgrading, which might mean some version of 4.6 should come sooner than later too. There are enough little changes to make it worthwhile, I think, and add this reason to the lot.
Last edited by Destry (2015-08-27 11:16:30)
Offline
Re: PHP 7: Call to undefined function mysql_connect()
Destry wrote #294382:
Well, that’s convenient. Most hosts will likely be upgrading PHP sooner than later, not downgrading, which might mean some version of 4.6 should come sooner than later too. There are enough little changes to make it worthwhile, I think, and add this reason to the lot.
+1
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: PHP 7: Call to undefined function mysql_connect()
PHP7 release is scheduled on nov 12th 2015.
Offline
Re: PHP 7: Call to undefined function mysql_connect()
Dreamhost sent me an e-mail the other day:
Starting on November 3, 2015, we will begin automatically updating domains from PHP 5.3 and PHP 5.4 to PHP 5.5. You will get an email when the update is complete.
We’re updating PHP because:
- PHP 5.3 has already been End-Of-Lifed (EOL’ed), which means the product is no longer receiving security updates from the developers at PHP.net.
- PHP 5.4 will EOL later this year.
- PHP 5.5 is well tested, stable, and has been in production since June 2013.
- PHP 5.6 is well tested, stable, and has been in production since August 2014. You can check out all the cool features on our wiki.Most sites should update just fine from PHP 5.3 or PHP 5.4 to PHP 5.5. However, there are some cases where sites can break — usually from custom or third-party scripts, or from using out of date 1-Click Installs. Our wiki has all the details.
5.6 is actually the latest version available and is the default for a new setup.
Offline
#6 2016-01-13 20:57:03
- zbs
- New Member
- Registered: 2016-01-13
- Posts: 1
Re: PHP 7: Call to undefined function mysql_connect()
Does TXP 4.5.7 work on PHP7?
I’m getting this error and mysql_connect() does not seem to be simply replaceable with mysqli().
Offline
Re: PHP 7: Call to undefined function mysql_connect()
No, but it will with Txp 4.6, which is expected to be released in the near future. (I don’t know when, exactly.)
Offline
Re: PHP 7: Call to undefined function mysql_connect()
Just as an fyi/fwiw
Dreamhhost announced this morning that PHP 7 is now available as an option. They consider it in “beta” for their support purposes.
They (correctly) list their one click install of Textpattern as incompatible.
When 4.6.x is released, it would be a good time to have them update their one click install version.
Offline
Re: PHP 7: Call to undefined function mysql_connect()
I was working on a site today on Dreamhost and upgraded everything.
Textpattern version: 4.6-dev (e2715e671d1f074ca73539ab35c05ba4)
Last update: 2016-04-19 13:56:44/2016-04-19 13:55:55
PHP version: 7.0.4
GD Graphics Library: bundled (2.1.0 compatible); supported formats: GIF, JPG, PNG.
I haven’t noticed any issues so far.
Offline
Re: PHP 7: Call to undefined function mysql_connect()
Ubuntu 16.04 LTS will likely hit the streets tomorrow and has PHP7 included: wiki.ubuntu.com/XenialXerus/ReleaseNotes#PHP_7.0
Offline
Re: PHP 7: Call to undefined function mysql_connect()
I moved a Textpattern site to a new host yesterday which is running PHP 7.0.1 – all working fine with latest 4.6dev (and is noticeable faster). I did have a couple of weird bits of PHP output on the prefs page while changing some prefs but that is gone now and the prefs have all saved fine – I haven’t been able to replicate that again either.
Offline