keygadgetz Posted January 22, 2021 Share Posted January 22, 2021 please see below error. it not allow me to use module anymore. i have trying to add 2checkout payment gateway on it and while adding it this error occurred. can you please help me to solve this error. [PrestaShop] Fatal error in module file :/home/key2015/public_html/classes/module/Module.php(1361) : eval()'d code: syntax error, unexpected 'use' (T_USE) thanks you Harsha Link to comment Share on other sites More sharing options...
musicmaster Posted January 23, 2021 Share Posted January 23, 2021 Your problem description is a bit summary. - provide your Prestashop version - have a look what is on line 1361 of Module.php and include it in your question. When you make life easy for the people who are here to answer your questions your chances to get an answer increase.. Link to comment Share on other sites More sharing options...
keygadgetz Posted January 27, 2021 Author Share Posted January 27, 2021 Prestashop 1.6.1.22 Link to comment Share on other sites More sharing options...
keygadgetz Posted January 28, 2021 Author Share Posted January 28, 2021 On 1/23/2021 at 6:17 PM, musicmaster said: Your problem description is a bit summary. - provide your Prestashop version - have a look what is on line 1361 of Module.php and include it in your question. When you make life easy for the people who are here to answer your questions your chances to get an answer increase.. Prestashop 1.6.1.22 Link to comment Share on other sites More sharing options...
musicmaster Posted January 28, 2021 Share Posted January 28, 2021 43 minutes ago, keygadgetz said: Prestashop 1.6.1.22 And what is on line 1361? Link to comment Share on other sites More sharing options...
keygadgetz Posted January 29, 2021 Author Share Posted January 29, 2021 21 hours ago, musicmaster said: And what is on line 1361? this is on 1361, if (eval('if (false){ '.$file."\n".' }') !== false) { Link to comment Share on other sites More sharing options...
keygadgetz Posted January 29, 2021 Author Share Posted January 29, 2021 21 hours ago, musicmaster said: And what is on line 1361? 1359 // If (false) is a trick to not load the class with "eval". 1360 // This way require_once will works correctly 1361 if (eval('if (false){ '.$file."\n".' }') !== false) { 1362 require_once(_PS_MODULE_DIR_.$module.'/'.$module.'.php'); 1363 } else { 1364 $errors[] = sprintf(Tools::displayError('%1$s (parse error in %2$s)'), $module, substr($file_path, strlen(_PS_ROOT_DIR_))); 1365 } please check and help me.... Link to comment Share on other sites More sharing options...
musicmaster Posted January 29, 2021 Share Posted January 29, 2021 That looks like tricky code. As I understand it a few lines before it loads the main file of a module ($module.'/'.$module.'.php'). And in this eval it evaluates that line. As that produces an error it suggests that that file for one of your modules contains invalid php. So now the trick is to find out which module has this problem. I would start with just adding some debug code that echoes the module name just before these lines. Link to comment Share on other sites More sharing options...
keygadgetz Posted January 30, 2021 Author Share Posted January 30, 2021 22 hours ago, musicmaster said: That looks like tricky code. As I understand it a few lines before it loads the main file of a module ($module.'/'.$module.'.php'). And in this eval it evaluates that line. As that produces an error it suggests that that file for one of your modules contains invalid php. So now the trick is to find out which module has this problem. I would start with just adding some debug code that echoes the module name just before these lines. I trying do add 2checkout payment gateway module in to prestashop and after that facing this issue. Is that module not support prestashop? And how I use that module? Link to comment Share on other sites More sharing options...
musicmaster Posted January 30, 2021 Share Posted January 30, 2021 3 hours ago, keygadgetz said: I trying do add 2checkout payment gateway module in to prestashop and after that facing this issue. Is that module not support prestashop? And how I use that module? Did you check your PHP version versus the PHP and PS versions that your version of this module supports? Try installing this module on a fresh Prestashop installation of the same version. It that gives the same error you might ask the supplier of the module. Link to comment Share on other sites More sharing options...
Makatserchyk Posted November 2, 2021 Share Posted November 2, 2021 On 1/30/2021 at 7:03 PM, keygadgetz said: I trying do add 2checkout payment gateway module in to prestashop and after that facing this issue. Is that module not support prestashop? And how I use that module? Hello, Did you solve the problem? Link to comment Share on other sites More sharing options...
przemex Posted November 4, 2023 Share Posted November 4, 2023 This error is related to the php version you have enabled, switch php on the server for the store to php 5.6 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now