Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-05-12 20:33:30

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 145
Website

mySQL vs mySQLi and TXP 4.6

I tried to install TXP 4.6.2 on a server running php 5.4.45, and couldn’t establish a connection to the database in setup:

Checking database connection
Fatal error: Call to undefined function mysqli_init() in 
/home/.../textpattern/setup/index.php on line 376

I received this response from the web-host:

The reason you’re getting the error when you try to setup textpattern is because mysqli_init() module has been disabled on the hosting server due to security reasons.

Do they have a point, or are they just trying to squirm out of the problem. I thought mySQLi was an improvement on mySQL…

Thanks!

Offline

#2 2017-05-12 21:20:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,585
Website

Re: mySQL vs mySQLi and TXP 4.6

giz wrote #305670:

I thought mySQLi was an improvement on mySQL…

It allows parameterized queries that help prevent injection attacks, but they’re not enforced. We don’t actually use them in core (yet). That said, the host probably removed mysql_* calls too for the same reason. PDO calls require parameters, making them far safer, so in that case the host is correct.

We only switched over to mysqli to buy us some time on newer versions of PHP. The long haul is to switch to PDO lock stock, though that brings with it annoying things such as not having the ability to do IN queries without parameterizing by hand. Plus we lose the ability to use MySQL extensions such as sorting by FIELD to maintain sort order, so we’ll have to do extra processing in PHP to maintain that feature of Txp. And PDO’s a few percent slower in most cases, as far as I know.

As for this issue, I don’t know what you can do. If they’ve turned off all direct MySQL call support in PHP, the current Txp won’t run unless support is enabled.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2017-05-13 00:59:26

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 145
Website

Re: mySQL vs mySQLi and TXP 4.6

Thanks Stef.

I’ve enquired as to whether they support direct MySQL calls, and will take it from there…

I may have to revert to TXP 4.5.7 if it comes to it…

Offline

Board footer

Powered by FluxBB