Post by msklut » Thu Apr 28, 2022 7:50 am

SOLUTION:
viewtopic.php?p=842235#p842235

Recently moved the storage folder outside public_html and updated config.php files, htaccess, refreshed cache from admin, etc, but still seeing 500 errors / blank pages. For example, the admin page loads and orders are visible, but when I click on the order it shows a 500 error / blank page. All the folders are set to 0755 and files to 0644. For testing, I tried setting these to 777 (I know it's a security no-no, it was just for testing), but it made no difference. Any ideas?

Errors:

Code: Select all

Warning: fopen(/home/adminuser/storage/logs/openbay.log): failed to open stream: 
Permission denied in /home/adminuser/storage/modification/system/library/log.php on line 22
Warning: fopen(/home/adminuser/storage/logs/openbay.log): failed to open stream: Permission denied in /home/adminuser/storage/modification/system/library/log.php on line 22
Warning: fclose() expects parameter 1 to be resource, bool given in /home/adminuser/storage/modification/system/library/log.php on line 39
Warning: fopen(/home/adminuser/storage/logs/error.log): failed to open stream: 
Permission denied in /home/adminuser/storage/modification/system/library/log.php on line 22

Warning:  fwrite()expects parameter 1 to be resource, bool given in /home/adminuser/storage/modification/system/library/log.php on line 31

/admin/config.php

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://mydomain.com/admin/');
define('HTTP_CATALOG', 'http://mydomain.com/');

// HTTPS
define('HTTPS_SERVER', 'https://mydomain.com/admin/');
define('HTTPS_CATALOG', 'https://mydomain.com/');

// DIR
define('DIR_APPLICATION', '/home/adminuser/public_html/admin/');
define('DIR_SYSTEM', '/home/adminuser/public_html/system/');
define('DIR_IMAGE', '/home/adminuser/public_html/image/');
define('DIR_STORAGE', '/home/adminuser/storage/');
define('DIR_CATALOG', '/home/adminuser/public_html/catalog/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/template/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'xxx');
define('DB_PASSWORD', 'xxx');
define('DB_DATABASE', 'xxx');
define('DB_PORT', '3306');
define('DB_PREFIX', '');

// OpenCart API
define('OPENCART_SERVER', 'https://www.opencart.com/');
/config.php

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://bumperplugs.com/');

// HTTPS
define('HTTPS_SERVER', 'https://bumperplugs.com/');

// DIR
define('DIR_APPLICATION', '/home/adminuser/public_html/catalog/');
define('DIR_SYSTEM', '/home/adminuser/public_html/system/');
define('DIR_IMAGE', '/home/adminuser/public_html/image/');
define('DIR_STORAGE', '/home/adminuser/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'xxx');
define('DB_PASSWORD', 'xxx');
define('DB_DATABASE', 'xxx');
define('DB_PORT', '3306');
define('DB_PREFIX', '');
OpenCart 3.0.2.0
PHP 7.4
PHP Handler suPHP
Apache 2.4
Last edited by msklut on Thu Apr 28, 2022 11:28 am, edited 1 time in total.

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Thu Apr 28, 2022 8:11 am

Ensure your CHMOD permission settings are recursively set from your storage folder and sub-folders to: 0755 and that your files remains on CHMOD 0644 recursively from FTP as well. Take note that these permission changes must be done without error messages during the process and that includes the process of moving those files to the storage folder outside of your public_html folder.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 8:15 am

straightlight wrote:
Thu Apr 28, 2022 8:11 am
Ensure your CHMOD permission settings are recursively set from your storage folder and sub-folders to: 0755 and that your files remains on CHMOD 0644 recursively from FTP as well. Take note that these permission changes must be done without error messages during the process and that includes the process of moving those files to the storage folder outside of your public_html folder.
That's how they are setup already. What else can I do? The error messages are auto-generated...

Image
Last edited by msklut on Thu Apr 28, 2022 8:17 am, edited 1 time in total.

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Thu Apr 28, 2022 8:17 am

msklut wrote:
Thu Apr 28, 2022 8:15 am
straightlight wrote:
Thu Apr 28, 2022 8:11 am
Ensure your CHMOD permission settings are recursively set from your storage folder and sub-folders to: 0755 and that your files remains on CHMOD 0644 recursively from FTP as well. Take note that these permission changes must be done without error messages during the process and that includes the process of moving those files to the storage folder outside of your public_html folder.
That's how they are setup already. What else can I do?

Image
Inside your logs folder, what is your CHMOD setting on your log file?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 8:19 am

Inside your logs folder, what is your CHMOD setting on your log file?
0644
Image

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Thu Apr 28, 2022 8:22 am

msklut wrote:
Thu Apr 28, 2022 8:19 am
Inside your logs folder, what is your CHMOD setting on your log file?
0644
Image
Without knowing what exactly happened during the move process of your folders and files from FTP, if you don't have access to SSH to manually set permissions to your folders and files, your best lead would be to your host on this one to complete the process.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 8:25 am

Without knowing what exactly happened during the move process of your folders and files from FTP, if you don't have access to SSH to manually set permissions to your folders and files, your best lead would be to your host on this one to complete the process.
I have SSH access, but if the folder permissions are already set to 0755 and files to 0644, what else is there to do?

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Thu Apr 28, 2022 8:26 am

msklut wrote:
Thu Apr 28, 2022 8:25 am
Without knowing what exactly happened during the move process of your folders and files from FTP, if you don't have access to SSH to manually set permissions to your folders and files, your best lead would be to your host on this one to complete the process.
I have SSH access, but if the folder permissions are already set to 0755 and files to 0644, what else is there to do?
To enforce permissions by using chown.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 8:29 am

To enforce permissions by using chown.
The directories should be set to 'owner:admin, group:admin', right?

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Thu Apr 28, 2022 8:30 am

msklut wrote:
Thu Apr 28, 2022 8:29 am
To enforce permissions by using chown.
The directories should be set to 'owner:admin, group:admin', right?
Depends on host settings.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 8:33 am

Code: Select all

[storage]# ls -al /home/adminuser/storage
drwxr-xr-x 95 adminuser adminuser 20480 Apr 27 20:00 cache
drwxr-xr-x  2 adminuser adminuser  4096 Jun 27  2021 download
drwxr-xr-x  2 adminuser adminuser  4096 Apr 27 10:42 logs
drwxr-xr-x  5 adminuser adminuser  4096 Apr 27 17:32 modification
drwxr-xr-x  2 adminuser adminuser  4096 May  7  2020 session
drwxr-xr-x  2 adminuser adminuser  4096 Apr 22 09:57 upload
drwxr-xr-x 15 adminuser adminuser  4096 Apr 20 16:50 vendor
All the directories are set as recommended... with admin as owner and admin as group.

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Thu Apr 28, 2022 8:34 am

msklut wrote:
Thu Apr 28, 2022 8:33 am

Code: Select all

[storage]# ls -al /home/adminuser/storage
drwxr-xr-x 95 adminuser adminuser 20480 Apr 27 20:00 cache
drwxr-xr-x  2 adminuser adminuser  4096 Jun 27  2021 download
drwxr-xr-x  2 adminuser adminuser  4096 Apr 27 10:42 logs
drwxr-xr-x  5 adminuser adminuser  4096 Apr 27 17:32 modification
drwxr-xr-x  2 adminuser adminuser  4096 May  7  2020 session
drwxr-xr-x  2 adminuser adminuser  4096 Apr 22 09:57 upload
drwxr-xr-x 15 adminuser adminuser  4096 Apr 20 16:50 vendor
All the directories are set as recommended... with admin as owner and admin as group.
Then, you'd need to contact your host to resolve this issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 9:01 am

Not sure how they'd be able to help given that we've already verified the folder/file permissions. Are there any other suggestions?

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by sw!tch » Thu Apr 28, 2022 9:09 am

For the 500 errors are you looking at your server error log or the opencart error log? For 500 errors you need to look at your server error logs not the opencart error log.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by msklut » Thu Apr 28, 2022 9:10 am

These are the only errors right now -- they show on the top of the site and on admin page.

Code: Select all

Warning: fopen(/home/adminuser/storage/logs/openbay.log): failed to open stream: Permission denied in /home/adminuser/storage/modification/system/library/log.php on line 22Warning: fopen(/home/adminuser/storage/logs/openbay.log): failed to open stream: Permission denied in /home/adminuser/storage/modification/system/library/log.php on line 22Warning: fclose() expects parameter 1 to be resource, bool given in /home/adminuser/storage/modification/system/library/log.php on line 39Warning: fopen(/home/adminuser/storage/logs/error.log): failed to open stream: Permission denied in /home/adminuser/storage/modification/system/library/log.php on line 22

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by msklut » Thu Apr 28, 2022 9:13 am

Do you see anything wrong with the config file? /storage/ path is set correctly. Some people online have suggested using this format, but it did not help.

Code: Select all

define('DIR_STORAGE', DIR_SYSTEM . '/storage/');

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by sw!tch » Thu Apr 28, 2022 9:15 am

cd /home/adminuser then ls -al check your permissions on the actual storage folder.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by straightlight » Thu Apr 28, 2022 9:17 am

msklut wrote:
Thu Apr 28, 2022 9:13 am
Do you see anything wrong with the config file? /storage/ path is set correctly. Some people online have suggested using this format, but it did not help.

Code: Select all

define('DIR_STORAGE', DIR_SYSTEM . '/storage/');
Unless your server path is otherwise than what it says it is on the topic, the storage folder location should be as it says.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by msklut » Thu Apr 28, 2022 9:19 am

sw!tch wrote:
Thu Apr 28, 2022 9:15 am
cd /home/adminuser then ls -al check your permissions on the actual storage folder.

Code: Select all

[adminuser]# ls -al
drwxr-xr-x  12 adminuser adminuser 4096 Apr 27 17:28 storage

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by msklut » Thu Apr 28, 2022 9:21 am

straightlight wrote:
Thu Apr 28, 2022 9:17 am
msklut wrote:
Thu Apr 28, 2022 9:13 am
Do you see anything wrong with the config file? /storage/ path is set correctly. Some people online have suggested using this format, but it did not help.

Code: Select all

define('DIR_STORAGE', DIR_SYSTEM . '/storage/');
Unless your server path is otherwise than what it says it is on the topic, the storage folder location should be as it says.
The /storage/cache folder has already generated new folders. It's something else... When I moved the /storage folder, is there anything that is possibly looking at the old directory for log files?

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC
Who is online

Users browsing this forum: Amazon [Bot] and 25 guests