Fatal error when plugins folder is not writeable

[ad_1]

We recently updated to the latest version and have fatal error log entries for every order created while the plugin was active. I had a chance to investigate this today.

2023-11-22T20:50:46+00:00 CRITICAL Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /var/www/abc/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php:1036

Line #1035 attempts to open a file for write in the includes folder of the plugin. Since the folder isn’t writeable by the web server, the fopen returns false.

I’d suggest moving this file to the server tmp folder which is always going to be writeable.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer