Why is my Laravel SEO sitemap generation failing after update?

Author
Emily Wilson Author
|
1 day ago Asked
|
1 Views
|
0 Replies
0

Hey everyone,

I'm tearing my hair out over here. I've been working on our 'Dynamic XML Sitemap for Laravel & All Websites' product, and after pushing a minor update yesterday, our auto-updating sitemap generation for client sites running Laravel is completely borked. It was working perfectly fine before, and now it's just... not.

The main issue is that the php artisan sitemap:generate command, which is crucial for our Laravel SEO sitemap functionality, is consistently failing with a weird memory limit error, even though I haven't changed any major dependencies or increased the data volume significantly. This is causing huge headaches for our clients' search engine visibility.

Here's what I've tried so far:

  • Increased memory_limit in php.ini to -1 (unlimited) and also to 2GB. No change.
  • Cleared all Laravel caches (php artisan cache:clear, config:clear, route:clear, view:clear).
  • Checked file permissions on the public and storage directories โ€“ they're all 775.
  • Reverted the code to a previous commit where it was working โ€“ same issue! This is the most frustrating part. It feels like something external might have changed, but I can't pinpoint it.
  • Manually run the command on the server, both as the web user and root.
  • Checked server logs (syslog, nginx error logs) for any related issues, but nothing stands out other than the PHP error itself.

The error I'm getting is consistently this:

[2023-10-27 10:45:01] local.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/spatie/laravel-sitemap/src/SitemapGenerator.php on line 123
{"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/spatie/laravel-sitemap/src/SitemapGenerator.php on line 123 at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:269)"}

This is happening even after setting memory_limit to much higher values. It's like the command isn't respecting the php.ini changes or something fundamental is misconfigured. Could it be a FPM setting? Or something in the php-cli configuration that's separate from FPM?

Has anyone encountered anything like this with spatie/laravel-sitemap or similar memory exhaustion issues that aren't resolved by php.ini adjustments? Any obscure server settings I should be looking at? I'm completely stuck and this is holding up several client launches.

Help a brother out please...

0 Answers

No answers yet.

Be the first to provide a helpful answer!

Your Answer

You must Log In to post an answer and earn reputation.