Page 1 of 1

Site does not work on localhost(xampp)

Posted: Mon Jul 24, 2017 10:01 pm
by Sidney-Melop
I am trying to run my site on localhost but after changing the config files and index.php I refresh the page and see these errors:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\xampp\htdocs\safetyelite\vqmod\vqmod.php on line 247

Code: Select all

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\xampp\htdocs\safetyelite\system\database\mysql.php on line 6

My config files and index.php look like this now and I don't know what else to do so I hope you can help:

<?php
// HTTP
define('HTTP_SERVER', 'http://safetyelite.co.za/');
define('HTTP_IMAGE', 'http://safetyelite.co.za/image/');
define('HTTP_ADMIN', 'http://safetyelite.co.za/admin/');

// HTTPS
define('HTTPS_SERVER', 'http://safetyelite.co.za/');
define('HTTPS_IMAGE', 'http://safetyelite.co.za/image/');

// DIR
define('DIR_APPLICATION', 'C:/xampp/htdocs/safetyelite');
define('DIR_SYSTEM', 'C:/xampp/htdocs/safetyelite/system/');
define('DIR_DATABASE', 'C:/xampp/htdocs/safetyelite/system/database/');
define('DIR_LANGUAGE', 'C:/xampp/htdocs/safetyelite/admin/language/');
define('DIR_TEMPLATE', 'C:/xampp/htdocs/safetyelite/admin/view/template/');
define('DIR_CONFIG', 'C:/xampp/htdocs/safetyelite/system/config/');
define('DIR_IMAGE', 'C:/xampp/htdocs/safetyelite/image/');
define('DIR_CACHE', 'C:/xampp/htdocs/safetyelite/system/cache/');
define('DIR_DOWNLOAD', 'C:/xampp/htdocs/safetyelite/download/');
define('DIR_LOGS', 'C:/xampp/htdocs/safetyelite/system/logs/');
define('DIR_CATALOG', 'C:/xampp/htdocs/safetyelite/catalog/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'safetyelite');
define('DB_PREFIX', '');
?>

if (!defined('DIR_APPLICATION')) {
    header('Location: /http://localhost/safetyelite/install/index.php');
    exit;
}

// VirtualQMOD
require_once('vqmod/vqmod.php');
$vqmod = new VQMod();

Re: Site does not work on localhost(xampp)

Posted: Tue Jul 25, 2017 3:12 am
by GilesM
You either need to run an older copy of PHP on your localhost (should be a setting in XAMPS) or update your copy of VQMOD to the latest version.

Regards.

Re: Site does not work on localhost(xampp)

Posted: Tue Jul 25, 2017 3:20 am
by victorj
unless you pointed your domain to your localhost, you need to change your config files.
replace safetyelite.co.za with localhost
access your store through localhost ie http://localhost

Depending on your opencart version
look in folder system/database en locate a file named mmysqli.php
if its not there upload attached file

in config files change

Code: Select all

define('DB_DRIVER', 'mysql');
to

Code: Select all

define('DB_DRIVER', 'mmysqli');

Re: Site does not work on localhost(xampp)

Posted: Tue Jul 25, 2017 3:07 pm
by Sidney-Melop
I just updated my vqmod folder to the very latest version I found on github, but when I refreshed the page it gave me this error:

Fatal error: Cannot instantiate abstract class VQMod in C:\xampp\htdocs\safetyelite\index.php on line 17

Have no idea about how to go from here