您好我生成一个数组组合列表我使用这个脚本。我的问题是我在几分钟后得到500内部服务器错误,我不知道为什么。 php和mysql超时设置为64000.也许有另一个好的解决方案来生成所有组合。我知道有很多组合。但我们的Server硬件非常好,所以我认为这不是问题所在。
ini_set("default_socket_timeout", 64000);
ini_set('mysql.connect_timeout', 64000);
error_reporting(E_ALL);
ini_set("display_errors", 1);
set_time_limit(0);
define("SYS_PATH", "");
function buildCombos($chars, $n)
{
if ($n <= 0) return array('');
$built = array();
foreach ($chars as $char)
foreach (buildCombos($chars, $n - 1) as $b)
$built[] = $b . $char;
return $built;
}
$chars = array('a', 'b', 'c', 'd', 'e', 'f', 'g','h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-');
$combo = buildCombos($chars, 4);
foreach ($combo as $key => $inhalt) {
set_time_limit(0);
$domain = $inhalt.'.de';
$dbusername = "xxx";
$dbdatabase = "xxx";
$dbhost = "localhost";
$dbpassword = "xxxx";
$link = mysql_connect($dbhost,$dbusername,$dbpassword);
mysql_select_db($dbdatabase);
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("INSERT IGNORE INTO de_list SET val = '$domain', val1 = 4, val2 = 0");
//
mysql_close($link);
}
echo 'Ready';