It does help. It says I'm not running the correct version of php. I'm surprised because I was certain I had other extension requiring php 8.
I'll start there and will report back if I have any other issues.
FoF Sitemap
luceos yes as it turns out, php -v
returns 7.4.33
. That said, if I roll out php 8.0.27 or 8.1.14, run the command you specify here
update --prefer-dist --no-dev -a -W
And then:
php flarum migrate
php flarum cache:clear
The site just breaks down and gives error 500 for any and all requests. Is there a documented migration path?
Things play friendly with me until I clear the cache. I'm running Flarum 1.6.3
blueCamel have you tried troubleshooting, https://docs.flarum.org/troubleshoot
Thank you, with your guidance, I was able to get on the php 8.1 bandwagon.
The composer why-not fof/sitemap 2.0
now gives me:
Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/cpanel/composer/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///opt/cpanel/composer/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\CompositeRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be usedto temporarily suppress the notice in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/CompositeRepository.php:180
Info from https://repo.packagist.org: #StandWithUkraine
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ArrayRepository.php:286
flarum/flarum - requires fof/sitemap (^1.0)
- Edited
blueCamel it looks like your Composer version is too recent for the PHP version it runs as EDIT: I think it's more likely the opposite. You probably updated PHP but are still running an older Composer version. You can check version with composer --version
If everything is up to date, you could just hide those deprecation notices in your php.ini
config. But I think if you have the right PHP version for your Composer version it shouldn't output any notice/warning.
In any case, if the Composer command reached the end, you can ignore those deprecation notices, they shouldn't prevent Composer from finishing its job.
clarkwinkelmann
I'm on 2.1.3 as far as composer is concerned. I guess I should aim for 2.5.4?
After updating composer, I was able to get fof-sitemap to the latest version by running the require
command.
Thanks everyone.
I hope I havent missed someone already addressing this
I am adding sitemap to my site to help with SEO and all that
/sitemap.xml has been added as a location as mentioned in the OP nginx troubleshooting. However I have it set to the multi map mode and it seems to put them in /public/sitemaps/sitemap/sitemap(number).xml, would I need to change the nginx.conf to reflect each one?
and so i'm not just being completely useless and not providing anything, if you're using nginx via docker and pushing the forum out that way, change both the in-docker nginx conf and the host one. That will at least get you somewhere, and make sure the location{ is separate from the other.
- Edited
Lumeinshin the sitemap at the well-known path /sitemap.xml
contains instructions to tell search engines where the individual map files are. It's expected for the auto-generated files to be found at a different path. All you need is to give the original /sitemap.yml
URL to search engines and they'll automatically figure it out.
EDIT: as to the nginx configuration, you probably don't need to change it further. The instructions in the README are because of an issue that only happens with that exact file path. If you get any error from the Google search console, please report back with the message!
clarkwinkelmann
thanks for the quick reply,
For both google and bing, both give a HTTP Error: 404. i'll give it a bit longer before I try changing more settings just to make sure the forum has had a chance to make its sitemap, although I doubt that'll do it
Lumeinshin as soon as the extension is enabled, trying to access <forum url>/sitemap.xml
should return an XML file with HTTP code 200. You can test it yourself in the browser. There is no file on disk with that name, that's normal. Flarum will automatically answer the URL with an auto-generated response. The change to nginx configuration is because sometimes nginx refuses to let Flarum generate an answer for that URL.
hmm, for me it says Flarum itself depends on 1.0, but uninstalling 1.0 and then installing 2.x again seems to have worked.
2.1.0
- feat: Adds a new default Resource added to the Provider:
StaticUrls
by @iPurpl3x in FriendsOfFlarum/sitemap47
This is a pseudo-resource, as it isn't related to any model. It contains a list of route names that can be iterated to generate URLs to static pages of the app. By default there are 2 static pages: index and tags. Tags are only present in the list if the tags extension is activated.
A new Extender (FoF\Sitemap\Extend\RegisterStaticUrl
) has been added, so that other extensions can add thier own static URLs to the list. Example:
new RegisterStaticUrl('reviews')
Hmm again it did not update by itself and I have to remove the old version and reinstall.
I also noticed that I don't actually get a /sitemap.xml but only the flarum internal 404 message (I have the nginx redirect working).
Any idea how to completely purge this extension and start new?
- Edited
IanM Thanks, I've tried it, I remember Clark telling me a very similar idea some time ago to register the static pages of flarum-pages-generator
, this will probably make things a lot easier.
It's strange that it works with some extensions and not with others, it throws an error when building the sitemap saying it can't find them, it's probably a matter of the extensions itself, for example with fof/gamification
it works great to register /rankings
where to add that nginx error rule , i added to config.php but still not working
clarkwinkelmann i don't understand nginx step , where i have to put that code , in which file , sitemap not working