XML Sitemap for XenForo 1.3 [Not needed, included in 1.4]

Was the previous version working for you?
There are no changes around the logic for finding the directory to write to that I can see
I had it turned off whilst awaiting an XF v1.3 compatible version, but previously working fine.
/admin.php?options/list/xenforo_sitemap | Sitemap directory is set to the default of "sitemap", so cannot see why it would be trying to target /root/sitemap/
 
Could you open the Cli.php file, and change
Code:
XenForo_Application::setDebugMode(false);
to
Code:
XenForo_Application::setDebugMode(true);

And run again?

I changed and an error after run.

[root@xxx ~]# php /home/xxx/public_html/forum/library/XfAddOns/Sitemap/Cli.php
Running from directory: /home/xxx/public_html/forum

An exception occurred: xcache_get(): XCache var cache was not initialized properly. Check php log for actual reason in Zend/Cache/Backend/Xcache.php on line 95
#0 [internal function]: XenForo_Application::handlePhpError(2, 'xcache_get(): X...', '/home/xxx/p...', 95, Array)
#1 Zend/Cache/Backend/Xcache.php(95): xcache_get('xxx_data_op...')
#2 Zend/Cache/Core.php(303): Zend_Cache_Backend_Xcache->load('xxx_data_op...', false)
#3 XenForo/Model/DataRegistry.php(87): Zend_Cache_Core->load('data_options')
#4 XenForo/Dependencies/Abstract.php(144): XenForo_Model_DataRegistry->getMulti(Array)
#5 XfAddOns/Sitemap/Cli.php(36): XenForo_Dependencies_Abstract->preLoadData()
#6 {main}


My config.php xcache settings:

$config['cache'] = array(
'enabled' => true,
'frontend' => 'Core',
'frontendOptions' => array(
'caching' => true,
'automatic_serialization' => false,
'cache_id_prefix' => 'xxx_',
'lifetime' => 1800
),
'backend' => 'Xcache',
'backendOptions' => array(),
'cacheSessions' => true
);
 
I had it turned off whilst awaiting an XF v1.3 compatible version, but previously working fine.
/admin.php?options/list/xenforo_sitemap | Sitemap directory is set to the default of "sitemap", so cannot see why it would be trying to target /root/sitemap/

When I run it independently via /admin.php?cron/ it works fine and creates/updates the files in sitemap/ directory.
So it works fine when run manually, but not when run via scheduled time. Definantly seems to be a coding issue?
 
When I run it independently via /admin.php?cron/ it works fine and creates/updates the files in sitemap/ directory.
So it works fine when run manually, but not when run via scheduled time. Definantly seems to be a coding issue?
It seems to be working fine for me
screenshot.webp

As for the /root/sitemap/ info... I wonder if /root/ means your actual forum ROOT and not actually /root (which as we all know is an actual home directory for user root on Linux - and if it IS using that, then that explains why it's getting a permission error. :p
Your sitemap is defined as the default sitemap correct (no path given for it)?
 
There is a different workflow going on, since the scheduled task would probably run from deferred.php while running manually would go from the admin.php controller

I'll take a look on hardening this to work on most setups. I might need to manually get the base directory of the installation in a similar way that the baseDir is taken for the Front Controller
 
There is a different workflow going on, since the scheduled task would probably run from deferred.php while running manually would go from the admin.php controller

I'll take a look on hardening this to work on most setups. I might need to manually get the base directory of the installation in a similar way that the baseDir is taken for the Front Controller
May you help my problem about run cli ?

http://xenforo.com/community/threads/sitemap-for-xenforo.26785/page-44#post-741950
 
I changed and an error after run.

[root@xxx ~]# php /home/xxx/public_html/forum/library/XfAddOns/Sitemap/Cli.php
Running from directory: /home/xxx/public_html/forum

An exception occurred: xcache_get(): XCache var cache was not initialized properly. Check php log for actual reason in Zend/Cache/Backend/Xcache.php on line 95
#0 [internal function]: XenForo_Application::handlePhpError(2, 'xcache_get(): X...', '/home/xxx/p...', 95, Array)
#1 Zend/Cache/Backend/Xcache.php(95): xcache_get('xxx_data_op...')
#2 Zend/Cache/Core.php(303): Zend_Cache_Backend_Xcache->load('xxx_data_op...', false)
#3 XenForo/Model/DataRegistry.php(87): Zend_Cache_Core->load('data_options')
#4 XenForo/Dependencies/Abstract.php(144): XenForo_Model_DataRegistry->getMulti(Array)
#5 XfAddOns/Sitemap/Cli.php(36): XenForo_Dependencies_Abstract->preLoadData()
#6 {main}


My config.php xcache settings:

$config['cache'] = array(
'enabled' => true,
'frontend' => 'Core',
'frontendOptions' => array(
'caching' => true,
'automatic_serialization' => false,
'cache_id_prefix' => 'xxx_',
'lifetime' => 1800
),
'backend' => 'Xcache',
'backendOptions' => array(),
'cacheSessions' => true
);

I haven't yet been able to reproduce it, sadly. Definitely the XCache is the piece that is not being initialized / causing conflict.
 
Never see anything in the server error log to indicate it is running, however the modification dates on the files indicate it is.
I removed the server error log feature, because people kept complaining again and again that the add-on was giving them an error, to which I had to explain "that is not error, that is just a message saying it is successful" :)

Then XenForo in (1.2?) added a nag message in the AdminCP if there is anything in the Error Log, and that aggraviated the situation :)

So, it no longer does that. But, yes, the recent timestamp is an indicator that the sitemap is getting generated. It is mature enough anyway that I don't really require the error message anymore to debug things, it just works.
 
I removed the server error log feature, because people kept complaining again and again that the add-on was giving them an error, to which I had to explain "that is not error, that is just a message saying it is successful" :)

Then XenForo in (1.2?) added a nag message in the AdminCP if there is anything in the Error Log, and that aggraviated the situation :)

So, it no longer does that. But, yes, the recent timestamp is an indicator that the sitemap is getting generated. It is mature enough anyway that I don't really require the error message anymore to debug things, it just works.

Well it's a very useful add-on, I thank you for it. Perhaps when you have time you should remove the option to have the error log show that it is running, with the checkbox "Log site map creation."
 
So, your cli.php doesnt work while enabled xcache on config.php ?
Apparently not.
I was using XCache myself for a while, but not for storage, that is untested.

If you manage to get it fixed, please share it with the rest of the thread, might be useful for somebody else.
 
Last edited:
mod rewrite for robots.txt is not working for me. When i go to website/robots.txt i get an error page: The requested page could not be found.

My htaccess file:

Code:
<IfModule mod_rewrite.c>

    RewriteEngine On

    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo
    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
   
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml) - [NC,L]
    RewriteRule (robots\.txt)$ robots.php [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 
Apparently not.
I was using XCache myself for a while, but not for storage, that is untested.

If you manage to get it fixed, please share it with the rest of the thread, might be useful for somebody else.
I still get same error, can you please fix your cli.php script while xenforo enabled storage cache ?
 
Mone says "cron entry was run successfully" but I never see info such as shown above (generating forums, generating index thread, etc.). Likewise, no entries in my server error log. Am I doing something wrong?
 
Back
Top Bottom