If you are getting the Deprecated: preg_replace(): error on your OpenCart sites, you can follow the steps below to fix this error.
Example Error:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/SITENAME/public_html/SITENAME/vqmod/vqmod.php on line 329
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/SITENAME/public_html/open/system/database/mysql.php on line 6
Reason for Error:
OpenCart deprecated: preg_replace(): error is a problem caused by vQmod. The possible cause of the error is that the vQmod version you are using is old. To fix this error, you can update your vQmod version or fix the problem by following the solution steps below.
OpenCart Deprecated: preg_replace(): Error Solution
- Connect to your site via FTP and open your vqmod/vqmod.php file.
- Find the line $modFilePath = preg_replace(‘/([^*]+)/e’, ‘preg_quote(“$1”, “~”)’, $modFilePath); and replace it with the following.
- $modFilePath = preg_replace_callback(‘/([^*]+)/’, function ($m) { return preg_quote($m[1], “~”); }, $modFilePath);
- Your problem will be solved.