Jump to content
Jack_mcs

Google XML Sitemap SEO

Recommended Posts

You have to try the alternate setting first. If that fails due to a permissions error, then you need to ask your host to look into it.

 

Yep. Did that. As I mentioned, the Alternate file failed completely. But the normal file was successful EXCEPT for the Pages Sitemap section, which is what many people here have had the same issue with. Why would it be successful with all section except this one? This doesn't sound like a permissions error, particularly given that there is no error message in this section when running in diagnostics mode. It sounds more like something in the code itself.

 

What makes me suspicious of this is that the code for this section is significantly different from the code for the other sections... it doesn't require the same database interaction.

 

Where would I start looking in the code itself for possible answers? I've seen quite a number of tweaks, but not for the later versions of osCommerce... these tweaks are years old and the code has changed significantly since then.

 

Or else there could possibly be a php.ini setting that is tripping it up... any further ideas?

 

thanks...

 

Martin

Edited by MartinLass

Share this post


Link to post
Share on other sites

Further to my last posts, is it possible to replace the $path variable with a hard-coded directory? I'm thinking that it's somehow not finding the right place to carry out the rest of this code... the path definition appears rather convoluted...

 

	function GeneratePagesSitemap(){
	$container = array();
	$changefreq = GOOGLE_SITEMAP_PAGES_CHANGE_FREQ;
	$priority = '.1';

 	include_once(DIR_WS_CLASSES . 'language.php');
 	$lng = new language();

   $slash = substr(DIR_FS_CATALOG, 0 -1) == '/' ? 1 : 0;
   $path = (($pos = strpos(DIR_FS_CATALOG, "googlesitemap")) !== FALSE) ? substr(DIR_FS_CATALOG, 0, -strlen('googlesitemap') - $slash) : DIR_FS_CATALOG;
   $pages = $this->GetPagesArray($path, DIR_WS_LANGUAGES . $lng->language['directory'], $lng->language['id']);

   for ($i = 0; $i < count($pages); ++$i)
   {
  	  $container[] = array('loc' => htmlspecialchars(utf8_encode($pages[$i]['filename'])),
	                         'lastmod' => $pages[$i]['lastmod'],
 		     			         'changefreq' => $changefreq,
				  		            'priority' => $priority
	                        );	             
   }

   if ($i > 0)
		  return $this->GenerateSitemap($container, 'pages');
} # end function  

Share this post


Link to post
Share on other sites

Yep. Did that. As I mentioned, the Alternate file failed completely.

I don't think you read my full reply.

then you need to ask your host to look into it.

Share this post


Link to post
Share on other sites

I don't think you read my full reply.

 

Yep... I read the full reply... and skirted the issue of trying to sort it out with the host company. This would mean that they would need to investigate the PHP code and/or PHP settings, which is highly unlikely that they would do. This issue is for a client of mine, and their hosting company sux. Moreover, I've had dealings with hosting companies for years, and their most common answer is "the problem is not on our end; it's on your end." ;-/

 

Thanks anyway... I know you're probably up the ears in these issues, and I appreciate that you're still here after many years of dealing with our stuff! lol!

 

Cheers,

Martin

Share this post


Link to post
Share on other sites

Yep... I read the full reply... and skirted the issue of trying to sort it out with the host company. This would mean that they would need to investigate the PHP code and/or PHP settings, which is highly unlikely that they would do. This issue is for a client of mine, and their hosting company sux. Moreover, I've had dealings with hosting companies for years, and their most common answer is "the problem is not on our end; it's on your end." ;-/

The standard method won't work for all sites so the alternate has to be used in those cases. Trying to troubleshoot the standard method is such a case is just wasting time. It may be that the alternate won't work either but it needs to be tried. The error you mentioned for it is a server issue so you don't have a lot of choices. If you can't get that error fixed, then you can play around with the code to try to figure out the problem but it isn't something that can be handled in a support thread like this. Good luck.

Share this post


Link to post
Share on other sites

I am getting this error

 

$this->savepath .= (substr($this->savepath, 0, -1) !== '') ? '' : ''; //append a slash if needed
}
else
$this->savepath = DIR_FS_CATALOG . (substr(DIR_FS_CATALOG, 0, -1) !== '') ? '' : '';

Share this post


Link to post
Share on other sites

I am getting this error

 

$this->savepath .= (substr($this->savepath, 0, -1) !== '') ? '' : ''; //append a slash if needed
}
else
$this->savepath = DIR_FS_CATALOG . (substr(DIR_FS_CATALOG, 0, -1) !== '') ? '' : '';

That's not an error, it is the code in the file. Are you saying you see the code displayed when you run the script?

Share this post


Link to post
Share on other sites

That's not an error, it is the code in the file. Are you saying you see the code displayed when you run the script?

 

Yes I am seeing the code displayed when i go to googlesitemap/index.php

 

I tried alternative and i got even more code, do you want to see that?

 

BTW I am running v2.3.1

 

Thanks!

Share this post


Link to post
Share on other sites

Yes I am seeing the code displayed when i go to googlesitemap/index.php

 

I tried alternative and i got even more code, do you want to see that?

 

BTW I am running v2.3.1

 

Thanks!

Hmm, I don't see how that could happen. Normally when that happens it is because of a mistake in the code changes of an installation but this contribution doesn't require any code changes. Please provide a link to googlesitemap/index.php. Also, if you haven't tried it yet, please turn on the diagnotic option. I doubt that it will help to see the problem but it won't hurt.

Share this post


Link to post
Share on other sites

On my live shop I get the permissions errors many other have complained of, on my dev shop it says it works yet the sitemap files are still empty.

 

I checked the permissions on the files and even went so far as to set them to 777 but it still did not work. I checked my configure.php file and the paths are right. I even checked it against the Admin>Tools>Server Info to make sure. I then contacted my host and they said to contact the developer. The response I got from them is:

 

The problem is that your script refers to the file called sitemapmanufacturers.xml in the root directory of the server, but none of users can access it, you should define your own directory as the path of that file: /home/chemist4/public_html

 

But the path specified in DIR_FS_CATALOG is /home/chemist4/public_html. It is not in any sub-directory. And I have compared my configure.php to the example in the link provided a few posts back about how it should be and it is correct.

 

So if the path is correct and the permissions are correct, why would it still not work?

 

And on my dev store, why would it say it did work yet really do nothing? Why do I not get the same error on both? If this just doesn't work on some servers, is there an alternative?

Share this post


Link to post
Share on other sites

On my live shop I get the permissions errors many other have complained of, on my dev shop it says it works yet the sitemap files are still empty.

is there an alternative?

Have you tried the alternate setting? The diagnostic?

Share this post


Link to post
Share on other sites

Have you tried the alternate setting? The diagnostic?

That is with the alternate setting. With the standard setting I just get an error. This is the result of the diagnostic:

 

Opening   /sitemapproducts.xml
FS_CAT    /home/chemist4/public_html/
Server    http://www.chemistrysetsandmore.com
Save Path /
WS_CAT    / 


Warning:  fopen(/sitemapproducts.xml) [function.fopen]: failed to open stream: Permission denied in /home/chemist4/public_html/googlesitemap/sitemap.class_Alternate.php on line 353

ERROR: Google Product Sitemap Generation FAILED!

Opening   /sitemapcategories.xml
FS_CAT    /home/chemist4/public_html/
Server    http://www.chemistrysetsandmore.com
Save Path /
WS_CAT    / 


Warning:  fopen(/sitemapcategories.xml) [function.fopen]: failed to open stream: Permission denied in /home/chemist4/public_html/googlesitemap/sitemap.class_Alternate.php on line 353

ERROR: Google Category Sitemap Generation FAILED!

Opening   /sitemapmanufacturers.xml
FS_CAT    /home/chemist4/public_html/
Server    http://www.chemistrysetsandmore.com
Save Path /
WS_CAT    / 


Warning:  fopen(/sitemapmanufacturers.xml) [function.fopen]: failed to open stream: Permission denied in /home/chemist4/public_html/googlesitemap/sitemap.class_Alternate.php on line 353

ERROR: Google Manufacturers Sitemap Generation FAILED!

Opening   /sitemapindex.xml
FS_CAT    /home/chemist4/public_html/
Server    http://www.chemistrysetsandmore.com
Save Path /
WS_CAT    / 


Warning:  fopen(/sitemapindex.xml) [function.fopen]: failed to open stream: Permission denied in /home/chemist4/public_html/googlesitemap/sitemap.class_Alternate.php on line 353

ERROR: Google Sitemap Index Generation FAILED!

Array
(
   [QUERY] => Array
       (
           [PRODUCTS] => Array
               (
                   [sTATUS] => success
                   [NUM_ROWS] => 140
               )

           [CATEOGRY] => Array
               (
                   [sTATUS] => success
                   [NUM_ROWS] => 24
               )

           [MANUFACTURERS] => Array
               (
                   [sTATUS] => success
                   [NUM_ROWS] => 12
               )

       )

   [sAVE_FILE_XML] => Array
       (
           [0] => Array
               (
                   [file] => /sitemapproducts.xml
                   [status] => failure
                   [file_exists] => false
               )

           [1] => Array
               (
                   [file] => /sitemapcategories.xml
                   [status] => failure
                   [file_exists] => false
               )

           [2] => Array
               (
                   [file] => /sitemapmanufacturers.xml
                   [status] => failure
                   [file_exists] => false
               )

           [3] => Array
               (
                   [file] => /sitemapindex.xml
                   [status] => failure
                   [file_exists] => false
               )

       )

)

 

The FS_CAT is correct, but it does not seem to be trying to open the files from there.

Share this post


Link to post
Share on other sites

That is with the alternate setting. With the standard setting I just get an error. This is the result of the diagnostic:

 

The FS_CAT is correct, but it does not seem to be trying to open the files from there.

Assuming this addon is installed correctly, there is something wrong with your configure file because the paths are not correct. This thread may help in fixing that.

Share this post


Link to post
Share on other sites

Assuming this addon is installed correctly, there is something wrong with your configure file because the paths are not correct. This thread may help in fixing that.

I have read that thread. Here is the example:

define('HTTP_SERVER', 'http://www.widgetsofdoom.com');
define('HTTPS_SERVER', 'https://secure.widgetsofdoom.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'www.widgetsofdoom.com');
define('HTTPS_COOKIE_DOMAIN', 'secure.widgetsofdoom.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', '/htdocs/widgetsofdoom/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

And here is my configure.php:

  define('HTTP_SERVER', 'http://www.chemistrysetsandmore.com');
 define('HTTPS_SERVER', 'https://www.chemistrysetsandmore.com');
 define('ENABLE_SSL', true);
 define('HTTP_COOKIE_DOMAIN', 'www.chemistrysetsandmore.com');
 define('HTTPS_COOKIE_DOMAIN', 'www.chemistrysetsandmore.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');
 define('DIR_WS_HTTP_CATALOG', '/');
 define('DIR_WS_HTTPS_CATALOG', '/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/chemist4/public_html/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

The store is in the root of the site and everything works fine. I really don't see anything that could be wrong. The googlesitemap folder and the xml files are in the "catalog", which in my case is the public_html folder.

 

So if there is something wrong with my configure file, please tell me where. I just can't see it.

Share this post


Link to post
Share on other sites

So if there is something wrong with my configure file, please tell me where. I just can't see it.

It looks fine to me.

Share this post


Link to post
Share on other sites

It looks fine to me.

I still don't know why there is a problem since everything looks like it should work, but I did find out that it was not "doing nothing" when I ran it on my dev store on localhost. I found that it did the same thing it tried to do on my live store: save the files to the root of the server. On localhost that is the root of my hard drive. Even though it was getting the DIR_FS_CATALOG correctly from my configure.php, it was not getting translated correctly into the $this->savepath variable. I changed line 324 of sitemap.class_Alternate.php from this:

    $filename = $this->savepath . $this->filename . $type;

to this:

    $filename = DIR_FS_CATALOG . $this->filename . $type;

and it works.

 

Is there some reason it would lose the value of the variable?

Share this post


Link to post
Share on other sites

None that I am aware of. I've never had to do that when I installed it and no one has mentioned it in this thread so I have to assume it is something in your setup.

Share this post


Link to post
Share on other sites

A quickie if i may - is 'Sitemap SEO' (and Google XML Sitemap SEO ) successful with v2.3.1 stores also ?

I'm not sure I understand what you mean by "successful with." But if you mean if they work with 2.3, this one will but Sitemaps SEO hasn't been converted yet.

Share this post


Link to post
Share on other sites

I have installed all the files and corrected the permissions, however, once trying this step:

 

5) Go to http://YOUR_DOMAIN/googlesitemap/index.php, where YOUR_DOMAIN is your domain.

If the sitemaps fail to generate, then go to admin->Configuration->Google XML SEO

and switch to the alternate class and try again. If the maps still fail, enable

the diagnostic option in the settings and try again. If the error isn't obvious

at that point, post the problem, along with the diagnostic output in the support thread.

 

Nothing loads up on the site, I get an error 500 internal service:

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@savingshub.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

Anyone know this fix?

Share this post


Link to post
Share on other sites

I have installed all the files and corrected the permissions, however, once trying this step:

 

5) Go to http://YOUR_DOMAIN/g...temap/index.php, where YOUR_DOMAIN is your domain.

If the sitemaps fail to generate, then go to admin->Configuration->Google XML SEO

and switch to the alternate class and try again. If the maps still fail, enable

the diagnostic option in the settings and try again. If the error isn't obvious

at that point, post the problem, along with the diagnostic output in the support thread.

 

Nothing loads up on the site, I get an error 500 internal service:

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@savingshub.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

Anyone know this fix?

I don't know what's causing that error but it is the type of error that will be recorded in the error log. You can look at the error log file in your root directory, if your host provides that, or ask your host to look at it and let you know what is causing the failure.

Share this post


Link to post
Share on other sites

Hello jack,

 

here is the latest error log:

[01-Sep-2011 16:15:37] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/savingsh/public_html/includes/classes/shopping_cart.php on line 303

[01-Sep-2011 16:31:04] PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/savingsh/public_html/includes/functions/database.php on line 103

 

I do not think these have anything to do with this current error. I tried it again today so the date should be sep 07 which it is not?

 

Any other things I may look at? i basically placed all files in the correct directory and gave them all 777 access and tried to open the index php =\ please let me know thank you

Share this post


Link to post
Share on other sites

Also, i tried re-uploading the SQL file and got this error, any clue if its related:

 

Error

 

SQL query:

INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible )

VALUES (

'289', 'Google XML SEO', 'Google XML Sitemap SEO Options', '29', '1'

);

 

 

MySQL said: b_help.png

#1062 - Duplicate entry '289' for key 1

Share this post


Link to post
Share on other sites

Hello jack,

 

here is the latest error log:

[01-Sep-2011 16:15:37] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/savingsh/public_html/includes/classes/shopping_cart.php on line 303

[01-Sep-2011 16:31:04] PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/savingsh/public_html/includes/functions/database.php on line 103

 

I do not think these have anything to do with this current error. I tried it again today so the date should be sep 07 which it is not?

 

Any other things I may look at? i basically placed all files in the correct directory and gave them all 777 access and tried to open the index php =\ please let me know thank you

You're correct. The above error doesn't have anything to do with this contribution. The error may not show up in the sites error log. You should ask your host to look at it. There isn't anything that I can think of that would cause that so I don't have any suggestions other than that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×