我想用PHP发送数百封电子邮件,并增加我在ini_set中使用的执行时间('max_execution_time',10); 但是在发送了30封电子邮件之后,浏览器会显示一个空白页面并且不向所有人发送电子邮件.
我也将限制改为300,600 ..
在我使用nginx和php-fpm之前,我使用了Apache,所以当我只想运行我的一个cron作业而没有时间执行限制时,我在PHP代码中使用了这些行:
set_time_limit(0);
ini_set('max_execution_time', 0);
Run Code Online (Sandbox Code Playgroud)
但是在我从Apache迁移到nginx之后,这段代码不起作用.我知道如何改变nginx.conf以增加最长执行时间.
但我想用PHP代码处理这个问题.有办法吗?我想只指定一个可以运行PHP代码的文件,没有时间限制.
我有一个sql转储文件.其中有185458条记录.例如
INSERT INTO `cities` (`city_id`, `city_name`, `countryId`, `stateid`, `countryCode`, `latitude`, `longitude`, `zip_code`) VALUES
(2, 'Djelfa', 67, 1, 'DZA', 34.67, 3.25, ''),
(3, 'Valenza', 115, 2, 'ITA', 45.02, 8.63, '15048'),
...
...
...
(185452, 'Bosendurnbach', 17, 771, 'AUT', 48.5, 15.77, ''),
(185453, 'Môlay', 79, 937, 'FRA', 47.73, 3.94, ''),
(185454, 'Miloszyce', 183, 422, 'POL', 51.05, 17.31, ''),
(185455, 'Lovce', 212, 698, 'SVK', 48.45, 18.37, ''),
(185456, 'Winchester', 174, 74, 'NZL', -44.2, 171.28, ''),
(185457, 'Wohlde', 62, 402, 'DEU', 54.4, 9.3, ''), …Run Code Online (Sandbox Code Playgroud)