Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API support for PHP fcgi #1127

Closed
ghost opened this issue Apr 9, 2016 · 5 comments
Closed

API support for PHP fcgi #1127

ghost opened this issue Apr 9, 2016 · 5 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Apr 9, 2016

The Google reader API fails to work on configurations using php-fpm due to the absence of getallheaders(), so, would it be possible to add one of the implementations discussed in the comments section of this page to work around this issue?

@Alkarex
Copy link
Member

Alkarex commented Apr 9, 2016

@squarefractal Could you please enable the logMe(debugInfo()); line https://github.com/FreshRSS/FreshRSS/blob/dev/p/api/greader.php#L545 and then show the part of your log_api.txt corresponding to the first failed request?

@Alkarex Alkarex added this to the 1.3.2-beta milestone Apr 9, 2016
@ghost
Copy link
Author

ghost commented Apr 10, 2016

@Alkarex:
This is what I get in the logs after enabling logging and making a request to /p/api/greader.php/check/compatibility:

2016-04-10T10:26:08-03:00   Array
(
    [date] => 2016-04-10T10:26:08-03:00
    [headers] => Array
        (
            [Connection] => keep-alive
            [Referer] => https://example1.com/rss/p/api/
            [Accept-Encoding] => gzip, deflate
            [Accept-Language] => en-US,en;q=0.5
            [Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
            [User-Agent] => Mozilla/5.0 (Windows NT 6.1; rv: 38.0) Gecko/20100101 Firefox/38.0
            [Host] => example1.com
        )

    [_SERVER] => Array
        (
            [USER] => www-data
            [HOME] => /var/www
            [ORIG_PATH_TRANSLATED] => /var/www/html/rss/p/api/greader.php/check/compatibility
            [ORIG_SCRIPT_FILENAME] => /usr/lib/cgi-bin/php7.0-fcgi
            [ORIG_SCRIPT_NAME] => /php7.0-fcgi
            [ORIG_PATH_INFO] => /rss/p/api/greader.php/check/compatibility
            [PATH_TRANSLATED] => /var/www/html/check/compatibility
            [PATH_INFO] => /check/compatibility
            [SCRIPT_NAME] => /rss/p/api/greader.php
            [REQUEST_URI] => /rss/p/api/greader.php/check/compatibility
            [QUERY_STRING] => 
            [REQUEST_METHOD] => GET
            [SERVER_PROTOCOL] => HTTP/1.1
            [GATEWAY_INTERFACE] => CGI/1.1
            [REDIRECT_URL] => /rss/p/api/greader.php/check/compatibility
            [REMOTE_PORT] => 35632
            [SCRIPT_FILENAME] => /var/www/html/rss/p/api/greader.php
            [SERVER_ADMIN] => [no address given]
            [CONTEXT_DOCUMENT_ROOT] => /usr/lib/cgi-bin/php7.0-fcgi
            [CONTEXT_PREFIX] => /php7.0-fcgi
            [REQUEST_SCHEME] => https
            [DOCUMENT_ROOT] => /var/www/html
            [REMOTE_ADDR] => 31.52.11.202
            [SERVER_PORT] => 443
            [SERVER_ADDR] => 100.231.41.42
            [SERVER_NAME] => example1.com
            [SERVER_SOFTWARE] => Apache
            [SERVER_SIGNATURE] => 
            [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
            [HTTP_CONNECTION] => keep-alive
            [HTTP_REFERER] => https://example1.com/rss/p/api/
            [HTTP_ACCEPT_ENCODING] => gzip, deflate
            [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
            [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
            [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; rv: 38.0) Gecko/20100101 Firefox/38.0
            [HTTP_HOST] => example1.com
            [SSL_SESSION_RESUMED] => Resumed
            [SSL_SESSION_ID] => 962d9531e14ed96b934478fd9f84a9c5043b1857a3b81865075ad5c6263a15a6
            [SSL_SERVER_A_SIG] => sha256WithRSAEncryption
            [SSL_SERVER_A_KEY] => rsaEncryption
            [SSL_SERVER_I_DN] => CN=example2.com,C=UK
            [SSL_SERVER_S_DN] => CN=example2.com,C=UK
            [SSL_SERVER_V_END] => Feb 24 09:59:17 2019 GMT
            [SSL_SERVER_V_START] => Feb 25 09:59:17 2016 GMT
            [SSL_SERVER_M_SERIAL] => F90BEA3EF53C2016
            [SSL_SERVER_M_VERSION] => 3
            [SSL_CLIENT_VERIFY] => NONE
            [SSL_CIPHER_ALGKEYSIZE] => 128
            [SSL_CIPHER_USEKEYSIZE] => 128
            [SSL_CIPHER_EXPORT] => false
            [SSL_CIPHER] => ECDHE-RSA-AES128-GCM-SHA256
            [SSL_COMPRESS_METHOD] => NULL
            [SSL_SECURE_RENEG] => true
            [SSL_PROTOCOL] => TLSv1.2
            [SSL_VERSION_LIBRARY] => OpenSSL/1.0.1f
            [SSL_VERSION_INTERFACE] => mod_ssl/2.4.7
            [SSL_SERVER_I_DN_CN] => example2.com
            [SSL_SERVER_I_DN_C] => UK
            [SSL_SERVER_S_DN_CN] => example2.com
            [SSL_SERVER_S_DN_C] => UK
            [SSL_TLS_SNI] => example1.com
            [HTTPS] => on
            [REDIRECT_STATUS] => 200
            [REDIRECT_HANDLER] => php7.0-fcgi
            [REDIRECT_SSL_SESSION_RESUMED] => Resumed
            [REDIRECT_SSL_SESSION_ID] => 962d9531e14ed96b934478fd9f84a9c5043b1857a3b81865075ad5c6263a15a6
            [REDIRECT_SSL_SERVER_A_SIG] => sha256WithRSAEncryption
            [REDIRECT_SSL_SERVER_A_KEY] => rsaEncryption
            [REDIRECT_SSL_SERVER_I_DN] => CN=example2.com,C=UK
            [REDIRECT_SSL_SERVER_S_DN] => CN=example2.com,C=UK
            [REDIRECT_SSL_SERVER_V_END] => Feb 24 09:59:17 2019 GMT
            [REDIRECT_SSL_SERVER_V_START] => Feb 25 09:59:17 2016 GMT
            [REDIRECT_SSL_SERVER_M_SERIAL] => F90BEA3EF53C2016
            [REDIRECT_SSL_SERVER_M_VERSION] => 3
            [REDIRECT_SSL_CLIENT_VERIFY] => NONE
            [REDIRECT_SSL_CIPHER_ALGKEYSIZE] => 128
            [REDIRECT_SSL_CIPHER_USEKEYSIZE] => 128
            [REDIRECT_SSL_CIPHER_EXPORT] => false
            [REDIRECT_SSL_CIPHER] => ECDHE-RSA-AES128-GCM-SHA256
            [REDIRECT_SSL_COMPRESS_METHOD] => NULL
            [REDIRECT_SSL_SECURE_RENEG] => true
            [REDIRECT_SSL_PROTOCOL] => TLSv1.2
            [REDIRECT_SSL_VERSION_LIBRARY] => OpenSSL/1.0.1f
            [REDIRECT_SSL_VERSION_INTERFACE] => mod_ssl/2.4.7
            [REDIRECT_SSL_SERVER_I_DN_CN] => example2.com
            [REDIRECT_SSL_SERVER_I_DN_C] => UK
            [REDIRECT_SSL_SERVER_S_DN_CN] => example2.com
            [REDIRECT_SSL_SERVER_S_DN_C] => UK
            [REDIRECT_SSL_TLS_SNI] => example1.com
            [REDIRECT_HTTPS] => on
            [REDIRECT_HTTP_AUTHORIZATION] => 
            [FCGI_ROLE] => RESPONDER
            [PHP_SELF] => /rss/p/api/greader.php/check/compatibility
            [REQUEST_TIME_FLOAT] => 1460162379.128
            [REQUEST_TIME] => 1460162379
        )

    [_GET] => Array
        (
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [INPUT] => 
)

2016-04-10T10:26:08-03:00   checkCompatibility()

@Alkarex Alkarex changed the title Add getallheaders() shim for configurations where it is missing. API support for PHP fcgi Apr 10, 2016
Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Apr 10, 2016
@Alkarex
Copy link
Member

Alkarex commented Apr 10, 2016

Thanks @squarefractal. It is not related to getallheaders() but to the use of another header name apparently: REDIRECT_HTTP_AUTHORIZATION instead of HTTP_AUTHORIZATION.

@ghost
Copy link
Author

ghost commented Apr 10, 2016

@Alkarex commented on Sunday, April 10, 2016 3:24:06 PM:

Have you switched on Apache's mod_rewrite?

Yes.

Do you have any kind of proxy in front of your Apache?

No.

Could you please try this patch? #1128

Adding the patch displays "PASS" when I check for compatibility, although I don't have a mobile device and a compatible app to test whether the Google API actually works.

@Alkarex
Copy link
Member

Alkarex commented Apr 24, 2016

Should be fixed. Please re-open if needed.

@Alkarex Alkarex closed this as completed Apr 24, 2016
@Alkarex Alkarex self-assigned this Apr 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant