Jump to content
Jack_mcs

Google XML Sitemap SEO

Recommended Posts

PHP Notice:  Undefined index: SCRIPT_NAME in /home/www/web587/html/ishop/includes/system/segments/application/request.php on line 17
X-Powered-By: PHP/7.1.1

still same notification 😞

i added some echo commands to dump some variables on the index.php file for tomorrows run at night.
These should be shown in the generated mail confirmation.
 

 

Edited by Philo2005

Share this post


Link to post
Share on other sites

The file I uploaded doesn't use the application_top file at all so I don't know how you are seeing that now. But it isn't something I can test since I don't have a live shop of that version of Phoenix so I can't help any further at this point. It is just a warning, as opposed to a fatal error, so  it can be ignored.  Set the cron job to ignore the output if you don't want to see it.

Share this post


Link to post
Share on other sites

well,  the online version runs without notice and works correct, so if the cron job fails, i will run the online version afterwards to make sure, the sitemaps file will be generated properly.
Anyway if I find something, i will let you know.

thanks for helping.

Edited by Philo2005

Share this post


Link to post
Share on other sites
7 hours ago, Philo2005 said:

so if the cron job fails,

To be clear,  the warning you are seeing is not fatal so the cron job should complete. Have you checked the sitemaps after the cron job runs to see if they are updated?

Share this post


Link to post
Share on other sites
On 11/4/2020 at 4:31 PM, Jack_mcs said:

To be clear,  the warning you are seeing is not fatal so the cron job should complete. Have you checked the sitemaps after the cron job runs to see if they are updated?

yes it is just a warning.

Share this post


Link to post
Share on other sites

I found out why the warnings comes up.

I renamed the index.php file to gsm_prc.php.
I adjusted the configuration table setting for 'GOOGLE_XML_SITEMAP_CREATE_NOW' to the new name of the script.

(This because there is already an index.php file on Phoenix root directory which could be a problem.)

The cron job could not attach the include files correctly because of wrong directory settings by the cron job itself.
I therefore set the directory setting to the actual of the script.php when not running a browser online request.

Here I have a proposal of how this could be solved:
 

//  set correct working directory for crown job
//  and select main directory for all
//  ------------------------------------------------------------
//    chdir('/home/user/web/domain.com/public_html/catalog/googlesitemaps/');
    if (! isset($_SERVER['HTTP_USER_AGENT'])) { // cron job
                chdir(__DIR__ . '/');
    }
    chdir('../');

What do you think?

 

Share this post


Link to post
Share on other sites
3 hours ago, Philo2005 said:

What do you think?

Looks good. As long as the map files are created and are correct, you should be all set.

Share this post


Link to post
Share on other sites
4 hours ago, Jack_mcs said:

Looks good. As long as the map files are created and are correct, you should be all set.

You may add this statement to your version, cron jobs will not always take over the directory settings according the online requests.
So for me the script works fine with Phoenix 1 0 7 10 without errors and warnings.

Share this post


Link to post
Share on other sites

There shouldn't be a reason to do that but since I can't test it, I may be wrong. I will keep this mind when I get around to do that. Thank you for posting it.

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

×