@zoul Have you restarted your web service?
Maximum execution time of 60 seconds exceeded
Hi all,
I did modify the time in pho.ini file to be max_execution_time = 1800 but i still having this issue.
Any idea please ? Thanks
thanks @tisuchi - yes
Add this iline in your .htaccess
php_value max_execution_time 1800
And verify changes using
phpinfo();
Thanks @manishchauhan. When running php artisan serve, i see robots.txt in message error as well:
PHP Fatal error: Maximum execution time of 60 seconds exceeded in D:\xampp\htdocs\Project\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php on line 255
2024-10-14 15:26:26 ............................................................................................................. ~ 1m
2024-10-14 15:26:26 ............................................................................................................. ~ 1m
2024-10-14 15:27:26 /robots.txt ..
robots.txt file having :
User-agent: *
Disallow: /user/*
Disallow: /admin/*
Sitemap: https://www.example.com/sitemap.xml
.htaccess
RewriteOptions inherit
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^example\.com$ "https\:\/\/www\.example\.com\/" [R=301,L]
php_value max_execution_time 1800
@manishchauhan verified and changes applied in phpinfo.php
max_execution_time 1800 1800
max_file_uploads 20 20
max_input_nesting_level 64 64
max_input_time 60 60
Try increasing your memory limits
Hey @talnluck,, i did increase the memory but nothing changed memory_limit = 999M
You have two lots of settings. Command line and web. What are you doing when you get this error?
Hi @Snapey, i'm just running : php artisan serve
I'm working on it locally
What are you doing when you get this error?
@Snapey sorry for not being exact, i 'm working on sitemap.xml
@Zoul You were editing an xml file and this error popped up on your screen? Forget php settings and run a virus scanner.
Hi @JussiMannisto, yes, i was solving an issue with sitemap.xml and after sometime, i start having this maximum execution time issue.
and i did open a thread with sitemap problem : https://laracasts.com/discuss/channels/laravel/sitemap-is-not-working-on-multi-language-website#:~:text=Sitemap%20is%20not%20working%20on%20multi%20language%20website
Thanks, will try to virus scanner and see
@Zoul That was a joke. It's not a virus.
You obviously didn't get this error when you were just editing an XML file. It's coming from a PHP script somewhere. But that could mean opening a web page, posting a form, running an artisan command or a queued job, etc. @snapey has been asking what you are doing when you get this error, but you haven't answered that. "Working on sitemap.xml" tells nothing.
This is how i got your question and my basic level of laravel could not help! Sorry ! Thanks for your support
@Zoul @snapey and others are very helpful when they understand where the issue happened. Let me ask you in a slightly different way...
What happened after you did php artisan serve
- were there any errors? If no, what did you do next? Did you open the url in browser? Did you get the "max execution time" error when you opened the url in the browser? If no, maybe you went to some route like /dashboard and the you got the error.
Please let us know when the error came. I think people can then understand what happened and give you better answers.
Hey @experimentor, i know and i appreciate their support. Many of the issue i faced, solved by @snapey, i'm just saying i could not provide the answer they wanted because of my limited knowledge maybe.
I'm trying to configure automatic sitemap, since last week, all i do is generating the sitemap files using php artisan generate:sitemap to see if i got the result i want by checking http://127.0.0.1:8000/sitemap.xml since i'm still not gettng the desired result, i keep changing and modifying methods, function etc. I did not have this issue right after i started working on sitemap, it was after some time. Beside that, i have not touched other configuration on my project. Hope i could give more informations.
@Zoul "using php artisan generate:sitemap" was the answer I was looking for
This tells me that you are using command-line version of PHP and it is the CLI version that will be timing out, nothing to do with php artisan serve
Windows or Unix?
You can run php -i and then look for execution in the result
Sorry @Snapey, did not come to my mind that this was what you wanted. I have windows OS installed.
This is what execution shows after running php -i
Zend Max Execution Timers => disabled
max_execution_time => 0 => 0
@Zoul max_execution_time of 0 means the script will never timeout. So php artisan commands can run as long as they like.
Which is at odds with your statement about it occurring when you run your console command.
By the way, your robots.txt error is nothing to worry about, its just saying that someone asked for it but you dont have one (thats normal). But what, on your local network is trying to load robots.txt?
@Snapey I'm connecting my laptop using my mobile wifi.
I also deletd robots.txt file to see if something changes but i 'm still getting Maximum execution time of 60 seconds exceeded error
@Zoul how many versions of php do you have locally installed?
did you restarted your pc after this change in php.ini file?
Hi @TruptMan-Solutions, yes i did restarted my pc several times.
If you are running under artisan serve then you should remember that it is only capable of running a single thread and executing one request at once. If you try and query your own server from within your application then it will hang and timeout.
Perhaps if you are trying to access the sitemap you created via a URL in your app ?
Hey @Snapey, i see. I can't access even the main page of the my application, no page is accessible fo now.
I also deleted all sitemap file and i'm getting the same error
By the way. This demo is also explained by @Eric L. Barnes and its working for him https://laravel-news.com/laravel-automatic-sitemap
@Zoul ok so,
-
You made no mention in this question about the spatie package
-
Eric is running this against a production site (not artisan serve). Building a local sitemap would be utterly pointless
-
You don't mention if you are explicitly creating links or are crawling your site.
Hey @Snapey, sorry for missing out this, i also did mention in one of my reply another thread link pointing to sitemap issue, where i shared some ccdes. https://laracasts.com/discuss/channels/laravel/sitemap-is-not-working-on-multi-language-website#:~:text=Sitemap%20is%20not%20working%20on%20multi%20language%20website
From your point, i will delete all sitemap related code and redo it in production and see, finally to get rid of memory limit local issue. I wanted to check it first before delpoying in production becaue i'm not getting the desired results.
I'm trying to crawl my site, and have each link in 3 different language.
I appreciate so much your valuabe time
thanks @TruptMan-Solutions, could you please share how you temprary pointed the url to your website ? I can't open any of my application to test it locally as i have memory issue but it would be good to know.
public function sitemap1()
{
// in you app.php file under config folder . write the live site url.
// then revert it back when you're done generating the sitemaps.
$path = public_path('sitemap\sitemap1.xml');
SitemapGenerator::create(config('app.url'))
->writeToFile($path);
dd('done');
}
Thanks @TruptMan-Solutions
If you use an alternate web server you might be ok, ie not artisan serve.
But you don't want a site map that links to local urls.
Thanks @Snapey will note of that. The problem now is , i deleted all related sitemap files and still having the same issue, can't run my project anymore locally. What could be the last resort for this ?
@Zoul do you use Git? Checkout an earlier commit and check it works.
You are using Git arent you?
Please or to participate in this conversation.