Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress wp_创建_用户错误502坏网关_Php_Wordpress - Fatal编程技术网

Php Wordpress wp_创建_用户错误502坏网关

Php Wordpress wp_创建_用户错误502坏网关,php,wordpress,Php,Wordpress,我对wp_creae_user()函数有问题。 我必须用循环创建大量用户 这里有一个示例代码 $count = 0; $name = 'userTry'; while($count < 10) { $user_email = 'gggghhhtttffrr'.$count.'@mmmvvff.com'; $user_name = $name.$count; $user_id = username_exists( $user_name ); // Check if

我对wp_creae_user()函数有问题。 我必须用循环创建大量用户

这里有一个示例代码

$count = 0; 
$name = 'userTry';
while($count < 10) {
    $user_email = 'gggghhhtttffrr'.$count.'@mmmvvff.com';
    $user_name = $name.$count;

    $user_id = username_exists( $user_name ); // Check if username already exist

    if ( ! $user_id && false == email_exists( $user_email ) ) {
        $random_password = wp_generate_password( $length = 12, $include_standard_special_chars = false );
        $user_id = wp_create_user( $user_name, $random_password, $user_email );
    }
    $count++;
}
我怎样才能解决这个问题


谢谢

您是在同一站点插入用户还是在站点外插入用户?更多澄清用户在同一网站。我刚刚用这个代码创建了一个页面模板。当我打开页面时,脚本start.tested在localhost中运行良好,我无法理解如何修复它。。。如果循环只有5个用户,则所有用户都可以正常工作。。如果有更多用户,则5个用户出现502错误
upstream sent too big header while reading response header from upstream