tileserver-php icon indicating copy to clipboard operation
tileserver-php copied to clipboard

JSON metadata issue

Open piedmontlong opened this issue 8 years ago • 5 comments

Hi Everyone,

I'm using Windows XAMPP 5.6.23. After copying the files of tileserver-php to htdocs, it showed message "JSON metadata file is not valid, please check configuration of your server", and the error info in the IE browser: Notice: Undefined index: HTTP_X_FORWARDED_PROTO in H:\xampp\htdocs\tileserver-php\tileserver.php on line 1231 Do you have any idea to fix that? Thanks!

piedmontlong avatar Feb 03 '17 17:02 piedmontlong

Looks like regression on https://github.com/klokantech/tileserver-php/commit/5f314fef28a38d21fa4b83fa050f60c50632d63a

There seems to be a missing isset() test for HTTP_X_FORWARDED_PROTO .

Can you please fix it and a pull request @piedmontlong ?

klokan avatar Feb 03 '17 17:02 klokan

Fixed the showed the "Tileserver" page, the Git page is very slow on my side, please commit it if it is OK: $config['protocol'] = ((isset($_SERVER['HTTPS']) or $_SERVER['SERVER_PORT'] == '443') or isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) ? 'https' : 'http';

piedmontlong avatar Feb 03 '17 19:02 piedmontlong

I'm having the same error with a fresh install. you can check it here: https://rax2.hostcoloreurope.com/~juancarl/TILESERVER2/

ghost avatar Jun 05 '17 17:06 ghost

Your problem is that https://rax2.hostcoloreurope.com/~juancarl/TILESERVER2/index.json returns 404. It looks like that you have a problem with htaccess. This works: https://rax2.hostcoloreurope.com/~juancarl/TILESERVER2/tileserver.php

daliborjanak avatar Jun 05 '17 18:06 daliborjanak

yes but it looks for me that the request is a bit malformed:

This works: https://rax2.hostcoloreurope.com/~juancarl/TILESERVER2/ tileserver.php?/index.json

This does not: https://rax2.hostcoloreurope.com/~juancarl/TILESERVER2/index.json

Wouldn't be better to have the cleaner URL?

Besides that, if the second option works, this means the problem is no htaccess blocking access to the file. I tried some rewrite rules without success:

RewriteRule ^(.*)index.json tileserver.php?/index.json [NC,L,QSA]

On 5 June 2017 at 20:59, Dalibor Janák [email protected] wrote:

Your problem is that https://rax2.hostcoloreurope.c om/~juancarl/TILESERVER2/index.json returns 404. It looks like that you have a problem with htaccess. This works: https://rax2.hostcoloreurope.c om/~juancarl/TILESERVER2/tileserver.php

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/klokantech/tileserver-php/issues/96#issuecomment-306274041, or mute the thread https://github.com/notifications/unsubscribe-auth/AXbdkTEzcO5cG3llRGEDo-cXockycv-oks5sBFAmgaJpZM4L2mDu .

ghost avatar Jun 05 '17 22:06 ghost