RIP config.php hello classes/config.php

Hello,

I get this from the update daemon:
PHP Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in /var/www/ttrss/classes/config.php on line 3

I’m using php 7.0 under debian 9, might be the reason why?

Thanks

most likely, might want to upgrade to something newer. maybe 7.1 is the minimum now, i’m not really sure tbh.

e: going by PHP: Class Constants - Manual it looks like 7.1+ (class constant visibility modifiers)

I just ran a GIT pull and now the TT-RSS service won’t start. Error states:

Exception while creating PDO object:could not find driver

I updated the config.php file as listed in the above posts but has not been able to correct the issue. Help please?

and now we start the mop-up.

everyone below this post with a “i did something and it broke plz halp” is going to have a two week vacation. everyone else, don’t try to help them, that would just encourage them.

[quote=“Huy, post:41, topic:4337, full:true”]
I’m using php 7.0 under debian 8, might be the reason why?[/quote]
That’s also two whole major versions behind current Debian stable. Jessie (8) is only on “Extended Long Term Support” now, so you’re no longer maintained by Debian themselves. Do yourself a favour and update that to Debian 10 ASAP.

Ubuntu 16.04, on the other hand, is still maintained (for a few months) and also ships PHP 7.0 by default - so there might be more people who get tripped up by this.

That made it quick & easy - thank you!

I also had ‘86400*365’ 86400 * 30 configured in the new ‘config.php’. And, I was getting a ‘error 500’ when attempting to connect to my instance of tt-rss with no other obvious clues after updating my non-docker ‘config.php’. After seeing your comment regarding your issue with the ‘TTRSS_SESSION_COOKIE_LIFETIME’ I first comment out that line in ‘config.php’ and success, I was able to connect! Then I changed my value to ‘31536000’ as well. But, no good! … back again to the ‘error 500’ issue. Long story short, I had a misplace end quote in my ‘TTRSS_SESSION_COOKIE_LIFETIME’ which was causing the issue. Corrected that typo and now in my ‘config.php’ this works:

> putenv(‘TTRSS_SESSION_COOKIE_LIFETIME=86400*30’);

and does not cause any further unpleasantness. So thanks for that clue.

fwiw.

Edit to add: See fox’s post below for proper config of ‘TTRSS_SESSION_COOKIE_LIFETIME’ !

Thanks to fox for the elaboration.
.

you’re actually setting it to 86400. why?

  • your configured value for the environment variable is a string literal 86400*30.
  • that gets cast by php into an integer, php is lenient about these things so anything that sorta-kinda looks like a number is alright, it just strips anything from the end that is not numeric
  • resulting actual value used by tt-rss is 86400

you need to let php evaluate the multiplication operation or use an actual computed number, so this would work like you would expect:

putenv("TTRSS_SESSION_COOKIE_LIFETIME=".(86400*30));

because the part you’re evaluating is unquoted. this would also work:

putenv("TTRSS_SESSION_COOKIE_LIFETIME=2592000");

this, however, won’t:

putenv("TTRSS_SESSION_COOKIE_LIFETIME='2592000'");

because '2592000' is an invalid number, according to php, because it starts with a non-numeric character.

e: i’ve updated https://tt-rss.org/wiki/GlobalConfig with a few more examples and a tldr version of this post.

Opps! I’ve corrected that line in my ‘config.php’ and I’ll edit the my comments above to reflect my error. :frowning_face:

i delete all icons files and let tinyrss recreate them with default permissions. no errors!

I have my system set up using HTTP BASIC AUTH and had AUTH_AUTO_LOGIN set to true in my old config.php. I can’t get logged in from my mobile app (Android) and I had rebooted server and PC and can’t get in either (tried edge and firefox). Instead of being logged in after http basic auth I get a login page. I looked in classes/config.php and it is true there by default. Did something else change? I changed noting on my andoid app or PC.

So I am now locked out of my tt-rss. Will search the forum for a way to reset password as I can’t remember what I used when I set this up ages ago and don’t have mail set up/working.

i may have inadvertently broken auto login, i’ll take a look tomorrow.

there’s a faq entry.

i can confirm that auto login is working, my guess would be you forgot about auth_remote

putenv('TTRSS_PLUGINS=auth_remote');

I guess that’s why releases exists. Those recent changes break a lot of instances and plugins.

ys, that’s what i forgot. thanks. i did search and the FAQ has the answer, thanks.

there was a release and i blindly updated to it without reading anything

this situation is somehow entirely different from doing git pull origin master via cron, i’m sure.

It’s not about doing git pull via cron but also plugins

/edit: I know people don’t read (as everyone can see in this Thread) but it is impossible for plugin maintainers to update in time when you push a new commit

“I’ve updated to a new release and now my plugins don’t work”

somehow different etc etc

get good?

e: i’m sure replacing $$() with document.querySelectorAll() or w/e was such an absolutely titanic task these plugin developers needed three months working 9-5 to accomplish. :face_with_raised_eyebrow:

Just typing ‘localhost’ for TTRSS_DB_HOST use the unix_socket (whatever the port ; the PDO driver ignore it).

But, be sure your constant pdo_mysql.default_socket point to your socket file in PHP.ini or local config.