我需要生成一个站点地图。
我正在使用spatie/laravel-sitemap。我已经安装并发布了它,但是当我运行生成器时,Symphony会抛出一个致命的错误:Maximum execution time of 60 seconds exceeded
。
我有一个巨大的链接列表,只留下一个测试,但仍然得到相同的错误。
如何解决?这是我的web.php
代码:
<?php
use Spatie\Sitemap\SitemapGenerator;
// this link throws a fatal error: Maximum execution time of 60 seconds exceeded
Route::get('sitemap', function(){
SitemapGenerator::create('127.0.0.1:8000')->writeToFile('sitemap.xml');
return 'sitemap created';
});
// this link is tested and fully working
Route::get('', function () {
return view('home');
});