php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74181 Different configurations for serving www.php.net?
Submitted: 2017-02-28 14:47 UTC Modified: 2019-05-20 13:56 UTC
From: james at jameswestby dot net Assigned: petk (profile)
Status: Closed Package: Website problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2017-02-28 14:47 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-28 15:21 UTC] ramsey@php.net
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 15:25 UTC] ramsey@php.net
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.
 [2019-05-20 13:56 UTC] petk@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: petk
 [2019-05-20 13:56 UTC] petk@php.net
Hello, yes this was happening for a while when there were mirrors used. Now PHP site doesn't use the mirrors anymore and this should work ok now. Thanks for reporting issues you're having.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC