Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning: flock() expects parameter 1 to be resource, bool given #40

Open
rilwis opened this issue Jul 5, 2024 · 1 comment
Open

Comments

@rilwis
Copy link

rilwis commented Jul 5, 2024

When I update WordPress to 6.5.5 via WP-CLI, I got the following warnings:

Updating to version 6.5.5 (en_US)...
Using cached file '/home/ubuntu/.wp-cli/cache/core/wordpress-6.5.5-partial-4-en_US.zip'...
Unpacking the update...
Success: WordPress updated successfully.
PHP Warning:  fopen(/var/www/domain.com/wp-content/cache/surge/flags.json.php): failed to open stream: Permission denied in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 170
Warning: fopen(/var/www/domain.com/wp-content/cache/surge/flags.json.php): failed to open stream: Permission denied in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 170
PHP Warning:  flock() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 173
Warning: flock() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 173
PHP Warning:  fread() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 176
Warning: fread() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 176
PHP Warning:  ftruncate() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 194
Warning: ftruncate() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 194
PHP Warning:  rewind() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 195
Warning: rewind() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 195
PHP Warning:  fwrite() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 198
Warning: fwrite() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 198
PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 199
Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/domain.com/wp-content/plugins/surge/include/invalidate.php on line 199

The user in WP-CLI is not a root user. It's the owner of the WP root folder (not www-data). I guess it has something wrong with the permission, but I'm not sure.

Please take a look.

@kovshenin
Copy link
Owner

Thanks for the report. Looks like the owner of the WP root folder and the owner of the actual files in that folder are different users? Who does /var/www/domain.com/wp-content/cache/surge/flags.json.php belong to and what are the permissions on that? Does the plugin continue to work as expected after the update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants