tillkruss / Nginx-FastCGI-Cache

A WordPress plugin that purges Nginx cache zones.
48 stars 25 forks source link

WordPress 4.6 - request_filesystem_credentials issue #4

Closed polevaultweb closed 8 years ago

polevaultweb commented 8 years ago

Whenever I do anything in my site, like add a post I get redirected to a whitescreen asking for FTP credentials.

This only happens in 4.6, possibly related to https://core.trac.wordpress.org/changeset/38138 or https://core.trac.wordpress.org/changeset/38167

Error log output:

2016/08/31 17:41:18 [error] 21551#21551: *174 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function submit_button() in /home/user/mysite.com/public/htdocs/wp/wp-admin/includes/file.php:1263
Stack trace:
#0 /home/user/mysite.com/public/htdocs/wp-content/plugins/nginx-cache/nginx-cache.php(258): request_filesystem_credentials('', 'ftpext', false, '/home/user/mysi...', Array, true)
#1 /home/user/mysite.com/public/htdocs/wp-content/plugins/nginx-cache/nginx-cache.php(169): NginxCache->initialize_filesystem()
#2 /home/user/mysite.com/public/htdocs/wp-content/plugins/nginx-cache/nginx-cache.php(232): NginxCache->is_valid_path()
#3 /home/user/mysite.com/public/htdocs/wp-content/plugins/nginx-cache/nginx-cache.php(221): NginxCache->purge_zone()
#4 /home/user/mysite.com/public/htdocs/wp/wp-includes/plugin.php(524): NginxCache->purge_zone_once(409546)
#5 /home/user/mysite.com/public/htdocs/wp/wp-includes/post.php(5594): do_action('clean_post_cach...', 409546, Object(WP_Po" while reading response header from upstream, client: 86.165.9.62, server: mysite.com, request: "GET /?file=0&did=408478&vp_edd_act=download&expire=MTQ3Mjc0Nzg2NA%3D%3D HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "mysite.com"
tillkruss commented 8 years ago

Thanks! I'll fix this in a couple of days, because I'm moving houses at the moment. You're welcome to submit a PR in the meantime.

polevaultweb commented 8 years ago

Cheers @tillkruss - wouldn't know where to start :(

tillkruss commented 8 years ago

I just changed the output buffering. Could you try and replace your existing nginx-cache.php file with this new one: https://github.com/tillkruss/Nginx-FastCGI-Cache/blob/master/nginx-cache.php

... and let me know if that solves the issue.

polevaultweb commented 8 years ago

@tillkruss YES, fixed - thanks!

esaheiskanen commented 7 years ago

It seems that this bug reappeared with wordpress 4.7.2

PHP Fatal error: Uncaught Error: Call to undefined function submit_button() in /var/www/webroot/ROOT/wp-admin/includes/file.php:1264
Stack trace:
#0 /var/www/webroot/ROOT/wp-content/plugins/nginx-cache/nginx-cache.php(256): request_filesystem_credentials('', 'ftpext', false, '/dev/shm/nginx', Array, true)
#1 /var/www/webroot/ROOT/wp-content/plugins/nginx-cache/nginx-cache.php(169): NginxCache->initialize_filesystem()
#2 /var/www/webroot/ROOT/wp-content/plugins/nginx-cache/nginx-cache.php(232): NginxCache->is_valid_path()
#3 /var/www/webroot/ROOT/wp-content/plugins/nginx-cache/nginx-cache.php(221): NginxCache->purge_zone()
#4 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(300): NginxCache->purge_zone_once(618)
#5 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)
#6 /var/www/webroot/ROOT/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#7 /var/www/webroot/ROOT/wp-includes/post.php(5714): do_action('clean_post_cach...', 618, Object(WP_Post))
#8 /var/www/webroot/ROOT/wp-include in /var/www/webroot/ROOT/wp-admin/includes/file.php on line 1264
andrebalza commented 7 years ago

Wordpress 4.7.3, using Woocommerce. Any advice?

*8164 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function submit_button() in [...]/public/wp-admin/includes/file.php:1264 Stack trace: #0 [...]/public/wp-content/plugins/nginx-cache/nginx-cache.php(256): request_filesystem_credentials('', 'ftpext', false, '[...]', Array, true) #1 [...]/public/wp-content/plugins/nginx-cache/nginx-cache.php(169): NginxCache->initialize_filesystem() #2 [...]/public/wp-content/plugins/nginx-cache/nginx-cache.php(232): NginxCache->is_valid_path() #3 [...]/public/wp-content/plugins/nginx-cache/nginx-cache.php(221): NginxCache->purge_zone() #4 [...]//public/wp-includes/class-wp-hook.php(300): NginxCache->purge_zone_once(1713) #5 [...]/public/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #6 [...]/public/wp-includes/plugin.php(453): WP_Hook->do_action(Array" while reading response header from upstream, client: [...], server: [...], request: "POST /checkout-course-archive/?wc-ajax=checkout HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.1-fpm.sock:", host: "[...]", referrer: "[...]/checkout-course-archive/"

tradesouthwest commented 6 years ago

Ditto, on cPanel using Apache PHP/5.6.28 WP = 4.9.3

[10-May-2018 17:54:35 UTC] PHP Fatal error: Call to undefined function request_filesystem_credentials() in /home/leadspil/larryjudd.us/appeal/wp-admin/includes/class-wp-upgrader-skin.php on line 93