WordPress教程网
WordPress教程网

WordPress迁移到Kangle报错解决办法

当途网990

wordpress迁移到Kangle会访问出现 504 报错 (upstream protocol header size is too big),查阅资料,网上的解释都差不多,无外乎是cookie携带的header太多了,其实是header过大的问题,超出了默认的1k,就会引发上述错信息。在WordPress程序中有独立配置开启了display_errors,把它关闭或者直接修改警告的这个文件/wwwroot/wp-includes/functions.php 1618行:当把is_dir前面加一个@就关了警告,结果就是服务器 cpu 100% 导致宕机,无赖之下翻遍 google 终于找到WordPress官方修复办法:Index: src/wp-includes/functions.php===================================================================--- src/wp-includes/functions.php+++ src/wp-includes/functions.php@@ -1680,6 +1680,10 @@ function wp_mkdir_p( $target ) {// We need to find the permissions of the parent folder that exists and inherit that.$target_parent = dirname( $target );while ( \'.\' != $target_parent && ! is_dir( $target_parent ) ) {+ // Infinite loop protection (see https://core.trac.wordpress.org/ticket/43417)+ if ( dirname( $target_parent ) === $target_parent ) {+ break;+ }$target_parent = dirname( $target_parent );}这个只是临时解决,大家可以借鉴下,希望 WordPress 官方下次更新修正这个问题。

标签: WordPress迁移Kangle报错