ValterV Posted May 27, 2021 Share Posted May 27, 2021 [PrestaShop] Fatal error in module file :/home/hg22ow4m/public_html/modules/ps_eventbus/ps_eventbus.php: Class 'Symfony\Component\Dotenv\Dotenv' not found My Prestashop is 1.6.1 How i fix that error ? I cant open modules page Link to comment Share on other sites More sharing options...
ZHSoft Posted May 28, 2021 Share Posted May 28, 2021 The PHP library is missing, try to update it in the command line. composer update Link to comment Share on other sites More sharing options...
ValterV Posted May 28, 2021 Author Share Posted May 28, 2021 When i acess on modules page appears that message [PrestaShop] Fatal error in module file :/home/hg22ow4m/public_html/modules/ps_eventbus/ps_eventbus.php: syntax error, unexpected 'composer' (T_STRING), expecting function (T_FUNCTION) Sorry im not a code guy, but im trying. I put that code on that: * @return void */ private function loadEnv() { $dotEnv = new Symfony\Component\Dotenv\Dotenv(); $dotEnv->load(_PS_MODULE_DIR_ . 'ps_eventbus/.env.dist'); if (file_exists(_PS_MODULE_DIR_ . 'ps_eventbus/.env')) { $dotEnv->load(_PS_MODULE_DIR_ . 'ps_eventbus/.env'); } composer update } Link to comment Share on other sites More sharing options...
Rhobur Posted May 28, 2021 Share Posted May 28, 2021 composer require symfony/dotenv Link to comment Share on other sites More sharing options...
ValterV Posted May 28, 2021 Author Share Posted May 28, 2021 So * @return void */ private function loadEnv() { $dotEnv = new Symfony\Component\Dotenv\Dotenv(); $dotEnv->load(_PS_MODULE_DIR_ . 'ps_eventbus/.env.dist'); if (file_exists(_PS_MODULE_DIR_ . 'ps_eventbus/.env')) { $dotEnv->load(_PS_MODULE_DIR_ . 'ps_eventbus/.env'); } $dotEnv-> composer update } Its correct? Sorry im not a coder Link to comment Share on other sites More sharing options...
Rhobur Posted May 28, 2021 Share Posted May 28, 2021 "composer require symfony/dotenv" or "composer update" are to be run in the terminal while in the module's directory not in code. Link to comment Share on other sites More sharing options...
ValterV Posted May 28, 2021 Author Share Posted May 28, 2021 Thats new for me. How do you do that? Im in FTP module directory. Sorry my newbie question Link to comment Share on other sites More sharing options...
ValterV Posted May 28, 2021 Author Share Posted May 28, 2021 I found Prestashop error on Unknown error na linha 422 do ficheiro /home/hg22ow4m/public_html/override/classes/Cart.php [2048] Declaration of Cart::checkQuantities() should be compatible with CartCore::checkQuantities($return_product = false) or this is a problem because Ps event Bus? Link to comment Share on other sites More sharing options...
Rhobur Posted May 28, 2021 Share Posted May 28, 2021 change the /home/hg22ow4m/public_html/override/classes/Cart.php [2048] Declaration of Cart::checkQuantities() to /home/hg22ow4m/public_html/override/classes/Cart.php [2048] Declaration of Cart::checkQuantities($return_product = false) Link to comment Share on other sites More sharing options...
ValterV Posted June 7, 2021 Author Share Posted June 7, 2021 I have a module for pre order that cause that problem. Thanks for your help 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