PHP 7 - is it compatible, should we use it?

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
masgo
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 11 Feb 2015, 18:53

PHP 7 - is it compatible, should we use it?

Postby masgo » 04 Dec 2015, 04:13

PHP 7 was released today. Judging from the news, it is much faster because of *magic*. But, it is also not fully backward compatible.

Does anyone have experience with tt-rss and PHP 7?

I am also using MySQL, will it work? Because I read that PHP 7 removed some kind of MySQL module.

User avatar
Apathetic
Bear Rating Trainee
Bear Rating Trainee
Posts: 7
Joined: 19 Mar 2013, 11:17
Location: Moscow, Russia
Contact:

Re: PHP 7 - is it compatible, should we use it?

Postby Apathetic » 04 Dec 2015, 05:37

It looks like tt-rss is not compatible with php7 for now.
Ran a quick check with php7cc, the report is attached. As you can see most of the problems are caused by using mysql_connect, which is like totally depricated since php 5.5.
Attachments
results.txt
(4.24 KiB) Downloaded 283 times

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP 7 - is it compatible, should we use it?

Postby fox » 04 Dec 2015, 08:52

mysql_ stuff can be safely dropped, i guess, it is only for those people without mysqli

not sure about other stuff especially in third party libraries

until there's a backport for debian 8 i can't really look into this properly, not sure if that's available someplace

e: there is a backport and things are looking good so far

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP 7 - is it compatible, should we use it?

Postby fox » 04 Dec 2015, 09:17

upd, well it seems to be running so far on php7, looking through that report now

e: well it seems to be mostly easy to fix stuff

1. mysql driver doesn't matter because it is only used for legacy systems w/o mysqli. technically i guess its time to remove it but it doesn't harm anything.
2. i've removed those three reported by-reference assignments even though they seemingly work because, well, whatever, not much difference there anyway
3. disabled magic quotes in phpmailer - someone test if phpmailer still works
4. not sure about bitwise stuff in sphinx client - ?
5. not sure about deprecated constructors, this is all third party stuff I can't really be bothered to screw with as long as it works. maybe someone else can take a look at it.

if there's any broken stuff i guess we'll learn in the coming weeks/months.

masgo
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 11 Feb 2015, 18:53

Re: PHP 7 - is it compatible, should we use it?

Postby masgo » 04 Dec 2015, 15:13

wow you guys are FAST.

So, I also tested it out and it works without any errors.

User avatar
Skibbi
Bear Rating Disaster
Bear Rating Disaster
Posts: 61
Joined: 15 Mar 2013, 14:59
Location: Poland

Re: PHP 7 - is it compatible, should we use it?

Postby Skibbi » 17 Feb 2016, 12:12

Didn't want to spam with another thread so I write here. Recently tt-rss (debian testing + php7.0) started to show following error:

Code: Select all

E_DEPRECATED (8192)
lib/MiniTemplator.class.php:74
Methods with the same name as their class will not be constructors in a future version of PHP; MiniTemplator has a deprecated constructor [Last query: SELECT email, full_name FROM ttrss_users WHERE id = 1]1. plugins/mail/init.php(97): ttrss_error_handler(8192, Methods with the same name as their class will not be constructors in a future version of PHP; MiniTemplator has a deprecated constructor [Last query: SELECT email, full_name FROM ttrss_users WHERE
id = 1], lib/MiniTemplator.class.php, 74, Array)
2. plugins/mail/init.php(97): require_once()
3. classes/pluginhandler.php(12): emailArticle()
4. backend.php(126): catchall(emailarticle)

As far as I can see MiniTemplator is some third party library which development seems to be dead. Therefore at some point it will probably stop working at all in future versions of PHP.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP 7 - is it compatible, should we use it?

Postby fox » 17 Feb 2016, 12:30

this should be an easy fix (1003f71)

User avatar
Skibbi
Bear Rating Disaster
Bear Rating Disaster
Posts: 61
Joined: 15 Mar 2013, 14:59
Location: Poland

Re: PHP 7 - is it compatible, should we use it?

Postby Skibbi » 29 Mar 2016, 18:40

Another php7 warning:

Code: Select all

E_DEPRECATED (8192)
lib/gettext/gettext.php:36
Methods with the same name as their class will not be constructors in a future version of PHP; gettext_reader has a deprecated constructor

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP 7 - is it compatible, should we use it?

Postby fox » 30 Mar 2016, 09:57

should be fixed by 00b6b66

lekin
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 21 Aug 2016, 11:48

Re: PHP 7 - is it compatible, should we use it?

Postby lekin » 21 Aug 2016, 13:45

Installing TT-RSS on Arch Linux with MySQL/InnoDB (tt-rss: 1:r8015-1, mariadb: 10.1.16-1, php packages: 7.0.10, apache: 2.4.23) results in following error:

"PHP support for MySQL is required for configured DB_TYPE in config.php."

[21-Aug-2016 07:50:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/share/webapps/tt-rss/classes/db/mysql.php:7
## line 6+7: function connect($host, $user, $pass, $db, $port) {
## $this->link = mysql_connect($host, $user, $pass);
## <link removed on demand>:
## This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0.
## Instead, the MySQLi or PDO_MySQL extension should be used.
## php.ini: 'extension=pdo_mysql.so' is uncommented
Stack trace:
#0 /usr/share/webapps/tt-rss/classes/db.php(32): Db_Mysql->connect('localhost', 'ttrss', 'ttrss', 'ttrss', '3306')
#1 /usr/share/webapps/tt-rss/classes/db.php(47): Db->__construct()
#2 /usr/share/webapps/tt-rss/classes/logger/sql.php(5): Db::get()
#3 /usr/share/webapps/tt-rss/classes/logger.php(28): Logger_SQL->log_error(8192, 'Methods with th...', 'lib/gettext/str...', 145, '')
#4 /usr/share/webapps/tt-rss/include/errorhandler.php(69): Logger->log_error(8192, 'Methods with th...', 'lib/gettext/str...', 145, '')
#5 [internal function]: ttrss_fatal_handler()
#6 {main}
thrown in /usr/share/webapps/tt-rss/classes/db/mysql.php on line 7

Schema has been successfully created via command line
$ sudo mysql -p --user ttrss ttrss < /usr/share/webapps/tt-rss/schema/ttrss_schema_mysql.sql
and /etc/webapps/tt-rss/config.php edited manually (DB, URL, pwd-crypt).

Cache directories are secured acc. to 'Securing Cache Directories'; also includes an open_basedir statement:
php_admin_value open_basedir "/usr/share/webapps/tt-rss/:/etc/webapps/tt-rss/:/var/lib/tt-rss/:/tmp/"

Btw, I am not that sure...

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP 7 - is it compatible, should we use it?

Postby fox » 21 Aug 2016, 13:57

well have you tried reading the error message?

>Btw, I am not that sure...

me neither

e: this has nothing to do with php7, tt-rss tries mysql group of functions when mysqli is not available, as it is on your shitty misconfigured server. instead of reading the error message, however, you decided to post here.

lekin
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 21 Aug 2016, 11:48

Re: PHP 7 - is it compatible, should we use it?

Postby lekin » 21 Aug 2016, 14:17

Works with 'extension=mysqli.so' in php.ini.

You might consider to add this detail to 'Detailed PHP requirements'

Thanks for code and help !

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: PHP 7 - is it compatible, should we use it?

Postby sleeper_service » 22 Aug 2016, 02:54

no amount of docs will fix stupid.

masgo
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 11 Feb 2015, 18:53

Re: PHP 7 - is it compatible, should we use it?

Postby masgo » 02 Dec 2016, 19:04

I have just updated to PHP 7.1 - no problems so far


Return to “Support”

Who is online

Users browsing this forum: No registered users and 12 guests