Edit report at https://bugs.php.net/bug.php?id=74181&edit=1

 ID:                 74181
 Comment by:         [email protected]
 Reported by:        james at jameswestby dot net
 Summary:            Different configurations for serving www.php.net?
 Status:             Open
 Type:               Bug
 Package:            Website problem
 Operating System:   Linux
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Additionally, it sounds like you're scripts are getting tripped up my PHP.net's 
mirroring system. You might find the information here helpful:

http://php.net/mirrors.php
https://wiki.php.net/web/mirror
https://wiki.php.net/ideas/phpnetmirroring

Some of the mirrors likely have slightly different configurations.


Previous Comments:
------------------------------------------------------------------------
[2017-02-28 15:21:37] [email protected]

This doesn't address the problem you're having, but maybe you could modify the 
bot to use this to get the new versions, rather than scraping the site?

http://php.net/releases/index.php?json

Check out the notes in the right-hand sidebar here for details on other 
query-string options to provide: http://php.net/releases/

------------------------------------------------------------------------
[2017-02-28 14:47:29] james at jameswestby dot net

Description:
------------
Hi,

We have a bot that watches for new versions of php by scraping the website 
occaisionally.

It sometimes reported that it couldn't find the latest release in the page.

After debugging for a while I found that sometimes it was being redirected to 
`/search.php` by `http://www.php.net`.

Testing lots of queries against `www.php.net` shows different behaviours,
indicating perhaps a mix of servers for it, with different configurations?



Test script:
---------------
$ curl -I http://www.php.net/



Expected result:
----------------
Same behaviour whichever backend server is reached.

Actual result:
--------------
Here are two consecutive responses I received with curl -I:

HTTP/1.1 200 OK
Date: Tue, 28 Feb 2017 14:43:00 GMT
Server: Apache
Last-Modified: Tue, 28 Feb 2017 13:30:11 GMT
Content-language: en
X-Frame-Options: SAMEORIGIN
Set-Cookie: COUNTRY=NA%2C86.31.132.166; expires=Tue, 07-Mar-2017 14:43:00 GMT; 
path=/; domain=.php.net
Set-Cookie: LAST_NEWS=1488292980; expires=Wed, 28-Feb-2018 14:43:00 GMT; 
path=/; domain=.php.net
Link: <http://php.net/index>; rel=shorturl
Connection: close
Content-Type: text/html; charset=utf-8

HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Tue, 28 Feb 2017 14:43:01 GMT
Content-Type: text/html
Content-Length: 184
Connection: keep-alive
Location: http://php.net/

You can see that the nginx is behaving differently to the apache.

The bot was seeing a redirect to `/search.php` sometimes, but I haven't
seen that with curl yet.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74181&edit=1

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to