Php 使用Laravel 4.2中的Mail::send执行时间超过30秒时出错
我正在设置laravel发送电子邮件。所以,我在测试laravel发送100封电子邮件。有时有效,有时无效。我注意到,如果发送这100封电子邮件的时间超过30秒,那么它就会失败。但是,如果不到30秒,它将成功发送100封电子邮件Php 使用Laravel 4.2中的Mail::send执行时间超过30秒时出错,php,email,laravel-4,wampserver,execution-time,Php,Email,Laravel 4,Wampserver,Execution Time,我正在设置laravel发送电子邮件。所以,我在测试laravel发送100封电子邮件。有时有效,有时无效。我注意到,如果发送这100封电子邮件的时间超过30秒,那么它就会失败。但是,如果不到30秒,它将成功发送100封电子邮件 class EmailController extends BaseController { public function sendMail() { //user_json is data retrived from json
class EmailController extends BaseController
{
public function sendMail()
{
//user_json is data retrived from json
$users_json = 'json_input';
$users = json_decode($users_json, true);
foreach($users as $user)
{
Mail::send('message', $user, function($message) use ($user)
{
$message->to($user['email'], $user['first_name'])
->subject('Laravel Email Test');
});
}
}
}
我把wamp和我的laravel一起用。我增加了wamp中php.ini文件的执行限制
max_execution_time = 300
max_input_time = 600
memory_limit = 1024M
如果超过30秒,电子邮件发送仍然失败。在laravel中是否还有另一个php.ini文件需要更改以增加限制?有没有更好的方法来优化此邮件:像我每天可能需要发送10万封电子邮件一样发送?与许多Apache/php实例一样,WAMPServer中有2个php.ini文件 确保您正在使用WAMPManager图标菜单编辑Apache使用的菜单
wampmanager -> Apache -> httpd.conf
另一个位于\wamp\bin\php\phpx.y.z\php.ini中,在运行php CLI命令行界面时使用请在Webroot路径中创建一个php文件,并调用php函数检查php.ini中的更改是否设置正确。@xynn WampServer在WAMPServr主页上带有指向phpinfo的链接。