ltsp-cluster-control not working with PHP7

Bug #1667244 reported by Thomas Naefken
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ltsp-cluster-control (Ubuntu)
New
Undecided
Unassigned

Bug Description

OS: Ubuntu 16.04.2 LTS
Package : ltsp-cluster-control, version : 2.0.3-0ubuntu3
Further packages : apache2, PHP7

The script "ltsp-cluster-control/Admin/util/functions.php" uses the PHP-function "ereg_replace" (lines 82 and 84), which doesn't exist in PHP7.

--- snip ---
if($CONFIG["use_https"]=="false"){
  header("Location: http://".$prefix.ereg_replace('/[^/]*\.php$','/',$_SERVER['PHP_SELF']).$page.$param);
}else{
  header("Location: https://".$prefix.ereg_replace('/[^/]*\.php$','/',$_SERVER['PHP_SELF']).$page.$param);
}
--- snap ---

This error avoids "admin.php" to be executed.

Using the CLI and callig the admin.php manually, I get the error message (some warnings omitted here) :

--- snip ---
php /usr/share/ltsp-cluster-control/Admin/admin.php
...
PHP Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /usr/share/ltsp-cluster-control/Admin/util/functions.php:82
Stack trace:
#0 /usr/share/ltsp-cluster-control/Admin/util/functions.php(206): ltsp_goto()
#1 /usr/share/ltsp-cluster-control/Admin/util/check.php(31): isSession()
#2 /usr/share/ltsp-cluster-control/Admin/admin.php(23): include('/usr/share/ltsp...')
#3 {main}
  thrown in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 82
--- snap ---

Same problem here: (ubuntu 16.04 and PHP7)

php -f /usr/share/ltsp-cluster-control/Admin/admin.php
PHP Notice: Undefined index: ldap_host in /usr/share/ltsp-cluster-control/Admin/util/text-en.php on line 213
PHP Notice: Undefined index: ldap_version in /usr/share/ltsp-cluster-control/Admin/util/text-en.php on line 216
PHP Notice: Undefined index: auth_state in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 205
PHP Notice: Undefined index: auth_state in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 71
PHP Notice: Undefined index: HTTP_X_FORWARDED_HOST in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 77
PHP Notice: Undefined index: HTTP_HOST in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 80
PHP Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /usr/share/ltsp-cluster-control/Admin/util/functions.php:82
Stack trace:
#0 /usr/share/ltsp-cluster-control/Admin/util/functions.php(206): ltsp_goto()
#1 /usr/share/ltsp-cluster-control/Admin/util/check.php(31): isSession()
#2 /usr/share/ltsp-cluster-control/Admin/admin.php(23): include('/usr/share/ltsp...')
#3 {main}
  thrown in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 82

Hope ltsp-cluster people can do some upgrade here.

Dariosh Rizi (dnr-f)
description: updated
Revision history for this message
Dariosh Rizi (dnr-f) wrote :

I solved this problem by installing PHP5.6 parallel with PHP7:
===============================================================
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6 php5.6-mysql php5.6-pgsql php-gettext php5.6-mbstring php-mbstring php-xdebug libapache2-mod-php5.6

sudo a2dismod php7.0
sudo a2enmod php5.6

Restart the Apache2 and Postgresql:
sudo service apache2 restart
sudo service postgresql restart

Open your Firefox and go to the admin web page.

http://ltsp1/ltsp-cluster-control/Admin/admin.php
its working now for me.
Ubuntu 16.04 LTS

Dariosh Rizi

Revision history for this message
Thomas Naefken (tnaefken) wrote : Re: [Bug 1667244] Re: ltsp-cluster-control not working with PHP7
Download full text (3.8 KiB)

Hi, Dariosh,

many thanks for your detailed information !

I will try it later - maybe in some weeks unfortunately ;-(

Have a nice weekend,

Thomas

Am 2018-02-16 9:48, schrieb Dariosh Rizi:

> I solved this problem by installing PHP5.6 parallel with PHP7:
> ===============================================================
> sudo add-apt-repository ppa:ondrej/php
> sudo apt-get update
> sudo apt-get install php5.6 php5.6-mysql php5.6-pgsql php-gettext php5.6-mbstring php-mbstring php-xdebug libapache2-mod-php5.6
>
> sudo a2dismod php7.0
> sudo a2enmod php5.6
>
> Restart the Apache2 and Postgresql:
> sudo service apache2 restart
> sudo service postgresql restart
>
> Open your Firefox and go to the admin web page.
>
> http://ltsp1/ltsp-cluster-control/Admin/admin.php
> its working now for me.
> Ubuntu 16.04 LTS
>
> Dariosh Rizi
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1667244
>
> Title:
> ltsp-cluster-control not working with PHP7
>
> Status in ltsp-cluster-control package in Ubuntu:
> New
>
> Bug description:
> OS: Ubuntu 16.04.2 LTS
> Package : ltsp-cluster-control, version : 2.0.3-0ubuntu3
> Further packages : apache2, PHP7
>
> The script "ltsp-cluster-control/Admin/util/functions.php" uses the
> PHP-function "ereg_replace" (lines 82 and 84), which doesn't exist in
> PHP7.
>
> --- snip ---
> if($CONFIG["use_https"]=="false"){
> header("Location: http://".$prefix.ereg_replace('/[^/]*\.php$','/',$_SERVER['PHP_SELF']).$page.$param);
> }else{
> header("Location: https://".$prefix.ereg_replace('/[^/]*\.php$','/',$_SERVER['PHP_SELF']).$page.$param);
> }
> --- snap ---
>
> This error avoids "admin.php" to be executed.
>
> Using the CLI and callig the admin.php manually, I get the error
> message (some warnings omitted here) :
>
> --- snip ---
> php /usr/share/ltsp-cluster-control/Admin/admin.php
> ...
> PHP Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /usr/share/ltsp-cluster-control/Admin/util/functions.php:82
> Stack trace:
> #0 /usr/share/ltsp-cluster-control/Admin/util/functions.php(206): ltsp_goto()
> #1 /usr/share/ltsp-cluster-control/Admin/util/check.php(31): isSession()
> #2 /usr/share/ltsp-cluster-control/Admin/admin.php(23): include('/usr/share/ltsp...')
> #3 {main}
> thrown in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 82
> --- snap ---
>
> Same problem here: (ubuntu 16.04 and PHP7)
>
> php -f /usr/share/ltsp-cluster-control/Admin/admin.php
> PHP Notice: Undefined index: ldap_host in /usr/share/ltsp-cluster-control/Admin/util/text-en.php on line 213
> PHP Notice: Undefined index: ldap_version in /usr/share/ltsp-cluster-control/Admin/util/text-en.php on line 216
> PHP Notice: Undefined index: auth_state in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 205
> PHP Notice: Undefined index: auth_state in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 71
> PHP Notice: Undefined index: HTTP_X_FORWARDED_HOST in /usr/share/ltsp-cluster-control/Admin/util/functions.php on line 77
> PHP Notice: Undefined index: HTTP_HOST in /usr/share/ltsp-cluster-c...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.