• Resolved passer13

    (@passer13)


    After the last plugin update (4.8.5) got a lot of errors in nginx’s error logfile:
    “FastCGI sent in stderr: “PHP message: PHP Warning: flock() expects parameter 1 to be resource, boolean given in …./wp-content/plugins/shortpixel-image-optimizer/class/shortpixel_queue.php on line 67”
    I has to disable plugin because my site got stuck with 100% CPU load by php-fpm-pool-www.
    I use php 7.1

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ShortPixel

    (@shortpixel)

    Hi,

    The new version dropped the use of sessions and it’s using a file for the processing queue, could you please check that the plugin is allowed to create a file in the uploads folder? There should be a file called .shortpixel-q-1.

    Thread Starter passer13

    (@passer13)

    Yes, it was permission problem. Fixed.
    p.s. It would be nice if your plugin could check permission and warn the user in case of problems.

    Plugin Author ShortPixel

    (@shortpixel)

    Indeed, that’s what I’ll do in the next version. ?? Thanks for your feed-back!

    Andrew Wilder

    (@eatingrules)

    I just ran into this problem as well… it was causing ongoing 99.9% CPU usage! We have a remote script that runs wp-cli (“wp plugin list”), and that was what was triggering it. When I tested it myself on the command line, this warning just repeated indefinitely:

    Warning: flock() expects parameter 1 to be resource, boolean given in /home/123456.cloudwaysapps.com/asdfasdf/public_html/wp-content/plugins/shortpixel-image-optimiser/class/shortpixel_queue.php on line 67
    PHP Warning:  flock() expects parameter 1 to be resource, boolean given in /home/123456.cloudwaysapps.com/asdfasdf/public_html/wp-content/plugins/shortpixel-image-optimiser/class/shortpixel_queue.php on line 67

    Resetting permissions on the server solved the issue.

    Hope the new fix is coming soon so others don’t have to spend hours tracking this down, too.

    Plugin Author ShortPixel

    (@shortpixel)

    Just a quick update: the version 4.8.6 does warn about the permissions problem and also doesn’t load the CPU anymore.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Warning: flock() expects parameter 1 to be resource’ is closed to new replies.