• Resolved saphiro

    (@saphiro)


    Hi there

    I have this PHP Warning all the time

    PHP Warning: file_put_contents(/home/user/public_html/wp-content/cache/autoptimize/autoptimize_715767d514833dc001e6b49ab4fab830.php) [function.file-put-contents]: failed to open stream: No such file or directory in /home/user/public_html/wp-content/plugins/autoptimize/classes/autoptimizeCache.php on line 50

    I’m running the latest version of autoptimize 2.1.0

    Thank you!

    S

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    no idea what’s happening there @saphiro, as file_put_contents creates a file if it does not exist. are there any files in wp-content/cache/autoptimize/ or is this empty (apart from an index.html and .htaccess maybe)? maybe a problem with filesystem rights for the user the webserver is running under?

    Thread Starter saphiro

    (@saphiro)

    Hi!

    Yes, there are a lot of files (.php, .php.deflate, .php.gzip, .php.none)

    And the dashboard cache info says 10 archives 753 Kbytes.

    ?

    And this came up

    PHP Warning: file_put_contents(/home/user/public_html/wp-content/cache/autoptimize/autoptimize_0e8930769573a64f15e9025658478ed1.php.none) [function.file-put-contents]: failed to open stream: No such file or directory in /home/user/public_html/wp-content/plugins/autoptimize/classes/autoptimizeCache.php on line 51

    • This reply was modified 7 years, 11 months ago by saphiro.
    Plugin Author Frank Goossens

    (@futtta)

    OK, this is probably a race condition where 2 requests (page request by a visitor) are both triggering the same autoptimized file being created. as file_put_contents is called with the LOCX_EX flag, the first request gets an exclusive file lock (to write the file) leaving the second one to fail. In that case you can ignore these warnings as the file is being created (confirmed by the fact you have files in cache), albeit by another almost simultaneous process.

    Thread Starter saphiro

    (@saphiro)

    Ok,

    Thank you for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning’ is closed to new replies.