I have installed XAMPP on windows. Apache is running just fine on port 80 and 443, and mysql is also running on 3306. I am installing open cart 1.5 locally but on pre-installation its giving me error "Warning: MySQL extension needs to be loaded for Open Cart to work!" Mysql current settings is off. Every thing looks fine , i have searched a lot but couldn't find any thing. What should i do? My php version is PHP Version 5.5.33 and my open cart version is 1.5.4.
Asked
Active
Viewed 1.2k times
0
-
1The 1.5 branch is a couple of years old - there's a chance it requires the obsolete `mysql_*` extension which doesn't exist if you're using PHP 7. Try OpenCart 2.2 instead. – CD001 Mar 16 '16 at 13:07
-
Exactly this is the reason as em using PHP 7 so whats the solution actually i want to work in 1.5 to update my module? – Ammar Ul Hassan Mar 16 '16 at 13:10
-
Odds are - you can't; it sounds like it uses an obsolete PHP extension : http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php - your only *real* option is to use a newer version of OpenCart. – CD001 Mar 16 '16 at 13:20
-
FIne. just gone through this thread. and my conclusion is that i will need to install xampp's old version which supports mysql. Thanks for your time. – Ammar Ul Hassan Mar 16 '16 at 13:22
-
I'd not recommend downgrading to an old stack when you can just upgrade OpenCart tbh ... but it's your call. – CD001 Mar 16 '16 at 13:24
-
actually em bound because i have a web running on 1.5x and cant update it as its not clients requirement. so i have to develop the upcoming module in 1.5x – Ammar Ul Hassan Mar 16 '16 at 13:29
-
@CD001 I have tried the same in PHP Version 5.5.33and still getting the same error now what can be the reason? – Ammar Ul Hassan Mar 16 '16 at 14:40
2 Answers
4
Open file step_2.php under install folder comment the following line
/*
if (!extension_loaded('mysql')) {
$this->error['warning'] = 'Warning: MySQL extension needs to be loaded for OpenCart to work!';
}*/
On step 3 select MysqlI. It will work on PHP 7
Note : I know this is not a clean way, But we can use this as hack for 1.5.x versions.

gmsundar
- 61
- 6
0
Please open following folder: xampp\php
and edit php.ini in text editor. search for extension=php_mysql.dll and then remove ; form beginning of line. turn off the MySql server and turn on back. you will be good.

Hassan Khalafi
- 1
- 1