Fixing OpenCart Login Failure Due to Missing Logs Directory

We recently had someone come to us for OpenCart support after out of the blue they were unable to login to the admin area of OpenCart anymore. When they tried to log in with the correct credentials they were getting the following messages and nothing else:
Warning: fopen([redacted]/system/logs/openbay.log): failed to open stream: No such file or directory in [redacted]/system/library/log.php on line 6Warning: Cannot modify header information – headers already sent by (output started at [redacted]/admin/index.php:85) in [redacted[/system/library/response.php on line 12

Similar messages were being shown on other pages on the website.

The first warning shown indicated that there was a failure to open a file at /system/logs/openbay.log. When we started looking into things we noticed that there was no directory at /system/logs/, which was the defined location for the logs directory in the config.php file for OpenCart. After creating that directory the warning messages were gone and the website’s owner was able to successfully able to log in.

It is isn’t clear why the issue propped up at the time it did because the file that was unable to be written to was created but empty after the directory was created, so it didn’t seem like there was something that suddenly need to be written to that hadn’t before.

Leave a Reply

Your email address will not be published.