Hi I have a problem within my opencart site in version 2.0.1.1. with php 7.4. These errors are generated in the error log file:
PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/PHP Warning: flock () expects parameter 1 to be resource, bool given in /var/www/vhosts/PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file.php on line 51
2023-10-12 21:56:32 - PHP Warning: fwrite() expects parameter 1 to be resource, bool given in /var/www/vhosts/PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file.php on line 51
2023-10-12 21:56:32 - PHP Warning: fwrite() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 53
2023-10-12 21:56:32 - PHP Warning: fflush() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 55
2023-10-12 21:56:32 - PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 57
2023-10-12 21:56:32 - PHP Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 59
/httpdocs/system/library/cache/file.php online 53
2023-10-12 21:56:32 - PHP Warning: fflush() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 55
2023-10-12 21:56:32 - PHP Warning: flock() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 57
2023-10-12 21:56:32 - PHP Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/vhosts/######/httpdocs/system/library/cache/file .php online 59
These errors cause me to display the front of the site incorrectly. Can you help me solve this problem? Thank you
The issue is OpenCart us unable to write a cache file. Check the permissions on the system/cache directory.
If that small warning caused problems then you probably have display errors on. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false (2.2.x and above).
3. In your OpenCart Setting on the server tab set Display Errors to No.
If that small warning caused problems then you probably have display errors on. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false (2.2.x and above).
3. In your OpenCart Setting on the server tab set Display Errors to No.
As above it could be to do with reading/writing files, perhaps check you're not out of disk space and contact your host?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
The issue is OpenCart us unable to write a cache file. Check the permissions on the system/cache directory.
If that small warning caused problems then you probably have display errors on. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false (2.2.x and above).
3. In your OpenCart Setting on the server tab set Display Errors to No.
Do you have any other suggestions for me regarding this problem of mine? I thank you in advance.
If that small warning caused problems then you probably have display errors on. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false (2.2.x and above).
3. In your OpenCart Setting on the server tab set Display Errors to No.
Do you have any other suggestions for me regarding this problem of mine? I thank you in advance.
Only what has already been suggested.
Switch off display errors.
Check both your PHP and OpenCart error logs.
Check permissions.
Contact your host.
Disable any extensions.
Switch off display errors.
Check both your PHP and OpenCart error logs.
Check permissions.
Contact your host.
Disable any extensions.
Who is online
Users browsing this forum: No registered users and 53 guests