For what it is worth, I am not (and have not been) getting any log output from the plugin either.
I did see the issue with an empty text/html content when trying PHP 7. That was fixed by installing a missing package - it could have been php7.0-json, but I’m not sure (hard to keep notes late at night, sorry
).
You’re welcome. I’m glad it’s working for you. 
xtaz
34
It could indeed be a missing extension. Though you would expect the logs to state that fact wouldn’t you. There’s obviously something which is intercepting the logs I guess and not displaying them properly. My extensions are these… anything stand out as missing? JSON is there.
php72-7.2.0_1 PHP Scripting Language
php72-ctype-7.2.0_1 The ctype shared extension for php
php72-curl-7.2.0_1 The curl shared extension for php
php72-dom-7.2.0_1 The dom shared extension for php
php72-exif-7.2.0_1 The exif shared extension for php
php72-fileinfo-7.2.0_1 The fileinfo shared extension for php
php72-gd-7.2.0_1 The gd shared extension for php
php72-hash-7.2.0_1 The hash shared extension for php
php72-json-7.2.0_1 The json shared extension for php
php72-mbstring-7.2.0_1 The mbstring shared extension for php
php72-opcache-7.2.0_1 The opcache shared extension for php
php72-pcntl-7.2.0_1 The pcntl shared extension for php
php72-pdo-7.2.0_1 The pdo shared extension for php
php72-pdo_pgsql-7.2.0_1 The pdo_pgsql shared extension for php
php72-pgsql-7.2.0_1 The pgsql shared extension for php
php72-posix-7.2.0_1 The posix shared extension for php
php72-session-7.2.0_1 The session shared extension for php
php72-simplexml-7.2.0_1 The simplexml shared extension for php
Sorry for no replies. I set Discourse to Tracking, instead of Watching which apparently doesn’t email on replies.
What you can try is set display_errors to On then tcpdump the traffic. This might give you a better idea of what’s going on.
The 500 is usually because information PHP sends to Apache is invalid…usually this means errors are being put in the output stream, before the set of HTTP headers.
What OS, Apache version is this?
I would also double check your Apache errors log
xtaz
36
I’ve tried all of these things. It doesn’t log anything. It’s nginx and php-fpm. I’ve set all of the logging options to on, tcpdump’d the traffic between nginx and php-fpm. All that happens is it sends 200 OK and Content-Type: text/html with no additional content. It gives a 200 with display_errors On and 500 with it Off.
I suspect it’s because ttrss takes over the logging itself for showing logs in the preferences panel but for some reason logs from this plugin just go missing. Other errors from ttrss are logged in the panel as expected, and errors from any other PHP script are logged either to the display, or to the syslog file as you would expect.
I wonder if there’s an easy way to stop ttrss taking over the logs so that errors are handled by PHP normally? That might help.
Change the log setting in config.php. It’s near the bottom of the file.
I am genuinely trying to recreate your issue.
I setup a VM setup as follows:
FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017
nginx/1.12.2
PHP 7.2.1 (cli) (built: Jan 13 2018 01:10:44) ( NTS )
php72-ctype-7.2.1
php72-curl-7.2.1
php72-dom-7.2.1
php72-exif-7.2.1
php72-fileinfo-7.2.1
php72-gd-7.2.1
php72-hash-7.2.1
php72-iconv-7.2.1
php72-intl-7.2.1
php72-json-7.2.1
php72-mbstring-7.2.1
php72-opcache-7.2.1
php72-pcntl-7.2.1
php72-pdo-7.2.1
php72-pdo_pgsql-7.2.1
php72-pgsql-7.2.1
php72-posix-7.2.1
php72-session-7.2.1
php72-simplexml-7.2.1
postgres (PostgreSQL) 9.5.10
Upon installing tt-rss, the install procedure recommended php72-iconv-7.2.1 and php72-intl-7.2.1, which you don’t appear to have. I don’t see this making a difference, but just an FYI.
I would recommend the following:
Edit your /usr/local/etc/php.ini with the following directives:
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
error_log = php_errors.log
Edit your /usr/local/etc/php-fpm.conf to include directives:
error_log = log/php-fpm.log
Then, create php_errors.log in the root tt-rss folder e.g.:
touch /usr/local/www/nginx/tt-rss/php_errors.log
chmod 0777 /usr/local/www/nginx/tt-rss/php_errors.log
Restart php-fpm and check:
/var/log/php-fpm.log
/usr/local/www/nginx/tt-rss/php_errors.log
PHP errors really should appear in the System area of Preferences in tt-rss though, no matter how severe.
If that doesn’t work…
Can you provide your nginx, php-fpm, php confs?
Does this happen on a fresh tt-rss user?
xtaz
39
I’ve tried installing the two missing extensions and that hasn’t made any difference. Changing the logging option in config.php hasn’t helped. I’ve previously tried all of the log settings that you mention in your post and they don’t help. Here are my files: Dropbox - Error
The php config is relatively normal. The nginx config possibly isn’t. It maps the API to /ttrss/fever/ rather than the normal location. But this works fine on every fork of the code except for your version. I guess I can try changing this so it uses the more standard path?
Same thing happens on a fresh user.
What gets me is with display_errors = Off it shows 500 error, but with display_errors = On it shows 200 OK with content_type text/html rather than json. This makes me think the reason I’m not seeing any errors logged is because there arn’t any errors, just that the plugin isn’t working and returning blank content. But I don’t understand why it decides to send error 500.
I really don’t know what to say. The files you provide work perfectly fine on my install.
I fully replaced my php-fpm configs and php.ini. I created a /usr/home/xtaz/www/ttrss. Moved my tt-rss instance into it and git cloned my fever plugin into the plugins.local folder. I created a dummy user for basic authentication which you have in your nginx config.
When I browse to your alias /ttrss/fever, I get the usual “{“api_version”:3,“auth”:0,“error”:“NOT_LOGGED_IN”}” and no PHP errors. iOS clients like Reeder seem to work OK.
What endpoint are you using to test this?
Can you provide your full nginx config? I assume there is some missing because with the snippets you gave, you don’t have index.php set as an index file. I am using the stock config with additional lines in the server scope as follows:
index index.html index.htm index.php;
include ttrss.conf;
Have you modified fastcgi_params - this could be a source of problems ?
What exact version of FreeBSD, nginx and postgres are you using?
I can only assume something is funky with the full nginx config or a specific version that we don’t have in common.
The only other thing I can think of is something Postgres specific or wrong file/directory permissions. Have you done anything specific with Postgres? Perhaps share config files from /usr/local/pgsql/data/*.conf ?
EDIT: I was just reading this SO thread nginx - PHP FPM returns HTTP 500 for all PHP errors - Stack Overflow
So, does “php_flag[display_errors] = on” in your php-fpm.conf make a difference?
xtaz
41
php_flag[display_errors] = on also doesn’t make a difference.
I’ve uploaded the entire nginx config here now: Dropbox - Error , the only difference being I’ve excluded the users file with my passwords in it.
I’m also completely at a loss. It’s not like I don’t know what I’m doing as I do this as a job and I’ve done everything that I can think of. Logging works fine outside of the API, ttrss logs stuff itself fine, other PHP scripts all log errors fine.
The only thing left to me may be to try and go through the script line by line adding debug lines to see if I can find where it fails. It’s a shame that the changes between the git commit that broke it and where it worked is so huge or else I could probably easily figure this out.
Postgres is pretty much out of the box. The postgresql.conf isn’t touched at all, the pg_hba.conf has this in it to lock the ttrss user into only being able to access the ttrss database:
local ttrss ttrss scram-sha-256
If you get time to try and chuck some echo statements in there and see if you get any output…that would be appreciated.
But yeah, your full nginx config seems to work fine for me too (after I changed some paths and generated a self-signed cert).
I don’t suppose your postgres instance is chucking out errors for invalid queries? Mine seems to pump them to syslog by default.
xtaz
43
OK. I’ve worked it out. I apologise and I’m very grateful for all of the time that you’ve given into looking at this for me. But it seems that if I had taken a look into the actual script I would have found the problem immediately. I was just editing it to add some debugging and the first thing I see is this on line 10 of index.php:
error_reporting(E_ERROR | E_PARSE);
Guess what? If I change that to E_ALL then it outputs the error!
2018/01/22 14:31:05 [error] 17546#0: *7762 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(…/…/config.php): failed to open stream: No such file or directory in /usr/home/matt/www/ttrss/plugins.local/repos/fever/fever/index.php on line 12
So the actual root cause is how I install plugins.
in ttrss/plugins.local I have a repos directory. Inside that I git clone the fever repo. I then symlink ttrss/plugins.local/fever to ttrss/plugins.local/repos/fever/fever.
This means that when it’s looking for config.php it’s looking in the wrong directory as you are doing require_once “…/…/config.php”;
The previous code didn’t hardcode it like this. It used $tt_root = dirname(dirname(dirname($_SERVER[‘SCRIPT_FILENAME’])));
So at least now I know the problem and how to fix it.
xtaz
45
Yes. Feel free to throw bear pictures at me 
The idea is that I just wanted to keep the repo up to date with git pull and not have to manually copy files around. As the repository doesn’t have the init.php, index.php, fever_api.php files in the root of the repository. The other option would have been to clone it and copy those files wouldn’t it? Or is there something in git that I’m missing where you can clone subdirectories.
fox
46
you can always clone someplace else and symlink the directory
e: oh wait, that’s exactly what you did. nvm.
Yeah, I don’t know why someone changed the original directory structure. I will change it back.
I should have remembered about the error_reporting line…but that is mostly copied from tt-rss’s api/index.php
I will see about that obscure path checking for config.php also.
OK,
I have pushed all my changes to master. GitHub - DigitalDJ/tinytinyrss-fever-plugin: Tiny Tiny RSS Fever API Plugin
This should hopefully fix that issue and the PHP5 unserialize issue.
xtaz
49
Confirmed. I’ve tried the latest version and that now works fine with my obscure setup. Thank you very much for your help!
rahul
50
Still getting an error as I try to set the Fever API password; using the Bitnami AWS AMI (and concerned about breaking it, should I just pull down the current git).

rahul
51
I pulled down the current git, still getting the following:

The errors represent, from bottom to top, at attempt to set the fever-api user password followed by an attempt to login from Reeder.