facethefuture Posted May 19, 2016 Share Posted May 19, 2016 (edited) I am receiving errors in my logs everytime an order is manually added or a product is manually added. Please see below and advise if anyone can provide a fix to these issues? Error 1: When a manual order is added PHP Warning: Cannot modify header information - headers already sent by (output started at public_html/controllers/admin/AdminCartsController.php:465) in public_html/classes/controller/AdminController.php on line 1595 Here is the code from line 1595 of AdminController.php header('Cache-Control: no-store, no-cache'); Error 2: When a new product is added PHP Warning: Wrong parameter count for clearstatcache() in public_html/classes/Uploader.php on line 274Here is the code from line 274 of Uploader.php clearstatcache(true, $file_path); Are these errors anything to worry about? My shop seems to be working ok, however the error log file generate in my admin folder on the ftp is getting quite large because of these errors. I am using Prestashop 1.6.0.14 Thanks Edited May 24, 2016 by facethefuture (see edit history) Link to comment Share on other sites More sharing options...
facethefuture Posted May 24, 2016 Author Share Posted May 24, 2016 Thank you for your reply, commenting out those lines of code seems to have stopped the errors occuring in the error log. Thank you Link to comment Share on other sites More sharing options...
musicmaster Posted May 25, 2016 Share Posted May 25, 2016 "PHP Warning: Cannot modify header information" usually appears because there was an error message or warning. Other possible causes are "echo" debug messages that you inserted and accidental spaces outside the php area. You should look in the source code of page that shows this warning to see what that previous message was (rightclick in your browser on the page and select "show source"). In your case there was the message "(output started at public_html/controllers/admin/AdminCartsController.php:465) in public_html/classes/controller/AdminController.php on line 1595)". This is unusual but it may contain a clue. Removing the header () commands what you have done now is not a solution. It just hides the problem. 1 Link to comment Share on other sites More sharing options...
Enrique Gómez Posted December 1, 2016 Share Posted December 1, 2016 "PHP Warning: Cannot modify header information" usually appears because there was an error message or warning. Other possible causes are "echo" debug messages that you inserted and accidental spaces outside the php area. You should look in the source code of page that shows this warning to see what that previous message was (rightclick in your browser on the page and select "show source"). In your case there was the message "(output started at public_html/controllers/admin/AdminCartsController.php:465) in public_html/classes/controller/AdminController.php on line 1595)". This is unusual but it may contain a clue. Removing the header () commands what you have done now is not a solution. It just hides the problem. Those errors are really a nightmare. I'm sure it depends on the hosting configuration. Anyway, removing the header line it's not a good idea, so in my case I've preferred in AdminCartsController substitute the echo echo Tools::jsonEncode(array_merge($this->ajaxReturnVars(), array('errors' => $errors))); for die (Tools::jsonEncode(array_merge($this->ajaxReturnVars(), array('errors' => $errors)))); It's less dangerous than removing header in AdminController .. Regards Link to comment Share on other sites More sharing options...
n_s_simpson Posted January 16, 2018 Share Posted January 16, 2018 Did anyone figure out what causes this issue and what the proper fix is? Link to comment Share on other sites More sharing options...
n_s_simpson Posted January 17, 2018 Share Posted January 17, 2018 I am running 1.6.1.17 and PHP 7.0.22.I don't know whether this PHP warning came up on 5.6 or if it's only since upgrading.Everything works but it's a bit annoying having the PHP Warnings. I know how to suppress them but I'd like to know why it's doing it in the first place. Link to comment Share on other sites More sharing options...
n_s_simpson Posted January 17, 2018 Share Posted January 17, 2018 @Enrique Gómez - I have seen your suggestion about replacing echo for die but is that actually a solution or is it hiding the problem? 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