View Full Version : Impex help with function mysql_connect error

19 Apr 2018, 22:11
Hoping someone can help. I have the following error message:

function mysql_connect() called though not supported in the PHP build

I've spoken with my hosts who assure me they've switched mysql_connect on for my domain but that hasn't done anything. I'm still getting the same error message.

To confirm my steps thus far:

01. Downloaded impex from github.
02. Unpacked files from zip.
03. Renamed the folder to impex.
04. Edited config file to reflect both target and source.
05. Uploaded impex/ to public_html (same location as admincp directory).
06. Uploaded cpnav_impex.xml to includes/xml.
07. Signed into admincp > import > import > entered passcode

Then get the error message outlined above. As I said, my hosts assure me mysql_connect is turned on but I'm still getting the error message. Any other suggestions?

19 Apr 2018, 22:26
I checked the code and it's caused by:
die ('function mysql_connect() called though not supported in the PHP build');

And the only possible way this can happen is if the mysql_connect function does not exist.
Maybe it's less of a pain if you perform the impex import locally on your own PC?

19 Apr 2018, 22:48
My hosts said they have pinpointed the issue and taken it away to work on - not quite sure what they're doing then!

I'm a bit of a novice when it comes to this, so not sure how to do a local import on my PC?

PS - thanks for responding Dave.

19 Apr 2018, 22:49
Ah... well it involves setting up your own local webserver with use of XAMPP/WAMP.
Might be easier to wait for your host to resolve it.

19 Apr 2018, 22:53
Ha! Sounds like a treat.

Will see what the host comes back with - shame vB stopped supporting impex. I remember using it many years ago (2009-ish) - wonderful tool.

Not sure what we'll do if my host can't fix it.

19 Apr 2018, 22:58
Well if your host cannot fix it then it sounds like you need a different host in my opinion.

I'd say they stopped supporting Impex because it requires a significant amount of work to keep track of all the different forum software, then making sure that if they release updates it will still work with Impex. Along with that, if vBulletin does an update then it possibly needs adjustments as well.

Then we also have vBulletin 5 with a completely different database structure. It would of been a near full-time job to maintain it.

20 Apr 2018, 06:39
My host came back with this:

As per your issue, we have checked and found that MySQL extension is been replaced with MySQLi. Because the MySQL extension is deprecated after 5.5 PHP version.
Link to the same just for your reference http://php.net/manual/en/function.mysql-connect.php
So, in this case, you need to use MySQLi Or PDO_MySQL to its backend to get the database connected and the required extensions are enabled on the server below are the same.
[email protected] [~]# php -m | egrep mysql
[email protected] [~]# repoquery -q --whatprovides 'ea-php70-php-mysqli' | sort -V | tail -1
Also after further investigation, we have found that ImpEx requires MySQL extension for working. Kindly review the link >> https://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-impex-import-system/280288-function-mysql-connect-called-though-not-supported-in-the-php-build
Kindly get into contact with your developer and get the MySQL Or PDO_MySQL extension to be used to its backend as well get in contact with the application vendor for more details regarding same.
Please check and do let us know If you have any further query/doubts.


Is there an easy way to do any of what my host is saying? My read into it is that impex requires mysql and the host has enabled that or has that extension enabled already. And that what I now need is something to do with impex?

20 Apr 2018, 14:01
In that case nothing can be done without making a bunch of changes to the code of Impex.

21 Apr 2018, 10:22
Nightmare! Will probably leave this here for the time being.

If anyone familiar with Impex fancies talking me through the changes that need to be made (so I can understand the complexity of the task and possibly attempt the changes) or even undertaking paid work to make the changes, let me know.

21 Apr 2018, 14:32
Mainly this (https://github.com/vBZachery/vbimpex/blob/master/db_mysql.php) file needs to be modified to add MySQLi support.

09 Dec 2019, 21:39
mysql extension is removed in PHP 7, so you must run ImpEx in PHP 5.6 or earlier.