Email Addresses link Doesn't work

mail

(Héctor Pérez) #1

Just shows this message:

[64] Cannot use lexical variable $view as a parameter name

See the system log for details.

I just update the Server as a regular way, I don’t know what to do.


(Marc) #2

Can you post the list of installed updates and the errors or warnings on /var/log/messages ?


(Héctor Pérez) #3

this is /var/log/messages :

Feb 21 16:33:03 nethserver httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80
Feb 21 16:33:08 nethserver httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80

Where I can find the updates list? Here is yum.log for tody actions

Feb 21 14:31:55 Updated: systemd-libs-219-42.el7_4.7.x86_64
Feb 21 14:31:56 Updated: nethserver-sssd-1.3.6-1.ns7.noarch
Feb 21 14:31:56 Updated: 10:qemu-img-1.5.3-141.el7_4.6.x86_64
Feb 21 14:31:56 Updated: clamav-filesystem-0.99.3-4.el7.noarch
Feb 21 14:32:00 Updated: clamav-data-0.99.3-4.el7.noarch
Feb 21 14:32:01 Updated: clamav-lib-0.99.3-4.el7.x86_64
Feb 21 14:32:02 Updated: libvirt-libs-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:02 Updated: 12:dhcp-libs-4.2.5-58.el7.centos.1.x86_64
Feb 21 14:32:02 Updated: libdb-5.3.21-21.el7_4.x86_64
Feb 21 14:32:02 Updated: 32:bind-license-9.9.4-51.el7_4.2.noarch
Feb 21 14:32:16 Installed: webtop5-1.2.1-1.ns7.noarch
Feb 21 14:32:16 Updated: webtop5-zpush-1.1.3-1.ns7.noarch
Feb 21 14:32:17 Updated: 32:bind-libs-9.9.4-51.el7_4.2.x86_64
Feb 21 14:32:17 Updated: 32:bind-libs-lite-9.9.4-51.el7_4.2.x86_64
Feb 21 14:32:17 Updated: 12:dhcp-common-4.2.5-58.el7.centos.1.x86_64
Feb 21 14:32:17 Updated: libvirt-client-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:17 Updated: clamav-server-0.99.3-4.el7.x86_64
Feb 21 14:32:18 Updated: nethserver-mail-server-1.11.0-1.ns7.noarch
Feb 21 14:32:18 Updated: python-perf-3.10.0-693.17.1.el7.x86_64
Feb 21 14:32:19 Updated: binutils-2.25.1-32.base.el7_4.2.x86_64
Feb 21 14:32:20 Installed: python2-josepy-1.0.1-1.el7.noarch
Feb 21 14:32:20 Updated: python2-acme-0.21.1-1.el7.noarch
Feb 21 14:32:20 Updated: python2-certbot-0.21.1-1.el7.noarch
Feb 21 14:32:24 Updated: ntopng-data-3.3.180109-3804.noarch
Feb 21 14:32:24 Updated: kmod-libs-20-15.el7_4.7.x86_64
Feb 21 14:32:24 Updated: kpartx-0.4.9-111.el7_4.2.x86_64
Feb 21 14:32:29 Updated: systemd-219-42.el7_4.7.x86_64
Feb 21 14:32:29 Updated: dracut-033-502.el7_4.1.x86_64
Feb 21 14:32:29 Updated: kmod-20-15.el7_4.7.x86_64
Feb 21 14:32:30 Installed: pfring-7.1.0-1681.x86_64
Feb 21 14:32:30 Updated: initscripts-9.49.39-1.el7_4.1.x86_64
Feb 21 14:32:32 Updated: 12:dhclient-4.2.5-58.el7.centos.1.x86_64
Feb 21 14:32:35 Installed: ntopng-3.3.180109-3804.x86_64
Feb 21 14:32:36 Updated: 1:nfs-utils-1.3.0-0.48.el7_4.1.x86_64
Feb 21 14:32:36 Updated: 10:qemu-kvm-common-1.5.3-141.el7_4.6.x86_64
Feb 21 14:32:37 Updated: 10:qemu-kvm-1.5.3-141.el7_4.6.x86_64
Feb 21 14:32:37 Updated: systemd-sysv-219-42.el7_4.7.x86_64
Feb 21 14:32:37 Updated: libvirt-daemon-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:37 Updated: libvirt-daemon-driver-storage-core-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:37 Updated: libvirt-daemon-driver-network-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-driver-nwfilter-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-driver-qemu-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-driver-nodedev-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-driver-secret-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-driver-interface-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-config-nwfilter-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:38 Updated: libvirt-daemon-config-network-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-lxc-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-disk-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-logical-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-rbd-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-mpath-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-gluster-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-iscsi-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-scsi-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:39 Updated: libvirt-daemon-driver-storage-3.2.0-14.el7_4.7.x86_64
Feb 21 14:32:40 Updated: kernel-tools-libs-3.10.0-693.17.1.el7.x86_64
Feb 21 14:32:48 Updated: ocsinventory-reports-2.4.0-2.el7.ocs.noarch
Feb 21 14:33:06 Updated: nextcloud-12.0.5-1.ns7.noarch
Feb 21 14:33:06 Updated: shorewall-core-5.1.10.2-1.el7.noarch
Feb 21 14:33:07 Updated: shorewall-5.1.10.2-1.el7.noarch
Feb 21 14:33:07 Updated: nethserver-firewall-base-3.2.11-1.ns7.noarch
Feb 21 14:33:17 Updated: linux-firmware-20170606-58.gitc990aae.el7_4.noarch
Feb 21 14:34:51 Updated: ocsinventory-server-2.4.0-2.el7.ocs.noarch
Feb 21 14:34:51 Updated: php-composer-spdx-licenses-1.3.0-1.el7.noarch
Feb 21 14:34:52 Updated: composer-1.6.3-1.el7.noarch
Feb 21 14:34:52 Updated: ocsinventory-2.4.0-2.el7.ocs.noarch
Feb 21 14:34:57 Installed: kernel-3.10.0-693.17.1.el7.x86_64
Feb 21 14:34:58 Updated: nethserver-firewall-base-ui-3.2.11-1.ns7.noarch
Feb 21 14:34:58 Updated: nethserver-nextcloud-1.1.11-1.ns7.noarch
Feb 21 14:34:58 Updated: kernel-tools-3.10.0-693.17.1.el7.x86_64
Feb 21 14:34:58 Updated: libvirt-daemon-kvm-3.2.0-14.el7_4.7.x86_64
Feb 21 14:34:58 Updated: libvirt-3.2.0-14.el7_4.7.x86_64
Feb 21 14:34:58 Installed: nethserver-ntopng-2.1.0-1.ns7.noarch
Feb 21 14:34:58 Updated: dracut-network-033-502.el7_4.1.x86_64
Feb 21 14:34:58 Updated: dracut-config-rescue-033-502.el7_4.1.x86_64
Feb 21 14:34:58 Updated: 2:microcode_ctl-2.1-22.5.el7_4.x86_64
Feb 21 14:34:59 Updated: nethserver-dc-1.4.2-1.ns7.x86_64
Feb 21 14:35:01 Updated: certbot-0.21.1-1.el7.noarch
Feb 21 14:35:01 Updated: tuned-2.8.0-5.el7_4.2.noarch
Feb 21 14:35:01 Updated: clamav-0.99.3-4.el7.x86_64
Feb 21 14:35:01 Updated: nethserver-webtop5-1.2.1-1.ns7.noarch
Feb 21 14:35:01 Updated: clamav-server-systemd-0.99.3-4.el7.noarch
Feb 21 14:35:01 Updated: 32:bind-utils-9.9.4-51.el7_4.2.x86_64
Feb 21 14:35:01 Updated: libdb-devel-5.3.21-21.el7_4.x86_64
Feb 21 14:35:01 Updated: libdb-utils-5.3.21-21.el7_4.x86_64
Feb 21 14:35:02 Updated: clamav-update-0.99.3-4.el7.x86_64
Feb 21 14:35:02 Updated: libgudev1-219-42.el7_4.7.x86_64
Feb 21 14:35:02 Updated: iwl2030-firmware-18.168.6.1-58.el7_4.noarch
Feb 21 14:35:02 Installed: libsodium13-1.0.5-1.el7.x86_64
Feb 21 14:35:02 Updated: yum-3.4.3-154.el7.centos.1.noarch
Feb 21 14:35:02 Updated: iwl5000-firmware-8.83.5.1_1-58.el7_4.noarch
Feb 21 14:35:02 Installed: nethserver-samba-4.0.0-1.ns7.noarch
Feb 21 14:35:02 Updated: gtk-update-icon-cache-3.22.10-5.el7_4.x86_64
Feb 21 14:35:03 Updated: tzdata-java-2018c-1.el7.noarch
Feb 21 14:35:03 Updated: iwl135-firmware-18.168.6.1-58.el7_4.noarch
Feb 21 14:35:03 Updated: systemtap-sdt-devel-3.1-5.el7_4.x86_64
Feb 21 14:35:03 Updated: iwl2000-firmware-18.168.6.1-58.el7_4.noarch
Feb 21 14:35:04 Updated: gdb-7.6.1-100.el7_4.1.x86_64
Feb 21 14:35:04 Updated: iwl3945-firmware-15.32.2.9-58.el7_4.noarch
Feb 21 14:35:04 Updated: nethserver-lang-en-1.2.6-1.ns7.noarch
Feb 21 14:35:04 Updated: iwl105-firmware-18.168.6.1-58.el7_4.noarch
Feb 21 14:35:04 Updated: device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64
Feb 21 14:35:04 msodbcsql-13.1.9.2-1.x86_64: 100
Feb 21 14:35:04 Updated: iwl6050-firmware-41.28.5.1-58.el7_4.noarch
Feb 21 14:35:04 Updated: iwl100-firmware-39.31.5.1-58.el7_4.noarch
Feb 21 14:35:04 Updated: iwl3160-firmware-22.0.7.0-58.el7_4.noarch
Feb 21 14:35:05 Updated: iwl6000g2a-firmware-17.168.5.3-58.el7_4.noarch
Feb 21 14:35:05 Updated: libsodium-1.0.16-1.el7.x86_64
Feb 21 14:35:05 Updated: tzdata-2018c-1.el7.noarch
Feb 21 14:35:06 Updated: duplicity-0.7.16-1.el7.x86_64
Feb 21 14:35:07 Updated: kernel-headers-3.10.0-693.17.1.el7.x86_64
Feb 21 14:35:07 Updated: iwl5150-firmware-8.24.2.2-58.el7_4.noarch
Feb 21 14:35:08 Updated: iwl7265-firmware-22.0.7.0-58.el7_4.noarch
Feb 21 14:35:08 Updated: nethserver-lang-es-1.2.6-1.ns7.noarch
Feb 21 14:35:08 Updated: 1:iwl1000-firmware-39.31.5.1-58.el7_4.noarch
Feb 21 14:35:08 Updated: iwl6000-firmware-9.221.4.1-58.el7_4.noarch
Feb 21 14:35:08 Updated: iwl4965-firmware-228.61.2.24-58.el7_4.noarch
Feb 21 14:35:09 Updated: iwl6000g2b-firmware-17.168.5.2-58.el7_4.noarch
Feb 21 14:35:09 Updated: iwl7260-firmware-22.0.7.0-58.el7_4.noarch
Feb 21 14:35:09 Updated: libdb-5.3.21-21.el7_4.i686
Feb 21 14:35:09 Updated: systemd-libs-219-42.el7_4.7.i686
Feb 21 14:35:12 Erased: webtop5-core-1.1.6-1.ns7.noarch
Feb 21 14:35:12 Erased: ntopng-pcap-3.1.170812-3152.el7.centos.x86_64
Feb 21 14:35:18 Erased: nethserver-ibays-3.1.1-1.ns7.noarch
Feb 21 14:35:18 Erased: webtop5-libs-1.1.6-1.ns7.noarch
Feb 21 14:35:22 libsodium-1.0.5-1.el7.x86_64: ts_done name in te is msodbcsql should be libsodium-1.0.5-1.el7.x86_64
Feb 21 14:35:22 duplicity-0.7.15-1.el7.x86_64: ts_done name in te is libsodium should be duplicity-0.7.15-1.el7.x86_64
Feb 21 14:41:54 msodbcsql-13.1.9.2-1.x86_64: 100

(Marc) #4

Do you use the stock PHP version or one from SCL? Which version ( php -v )?


(Héctor Pérez) #5

php -v

[root@nethserver bash]# php -v
PHP 5.4.16 (cli) (built: Nov 15 2017 16:33:54)
Copyright © 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright © 1998-2013 Zend Technologies


(Marc) #6

Sorry, but I think you are using a different php version for httpd-admin.
I can reproduce the problem when using php 7.1

rpm -qa php* nethserver-php-scl

(Marc) #7

If the stock php version is not in use, a possible fix is to revert to the stock version. Otherwise, to keep php 7.1 (or alike) maybe this works:

You can make a backup of /usr/share/nethesis/NethServer/Module/MailAccount/User.php file and edit the original file with your preferred editor:

vi /usr/share/nethesis/NethServer/Module/MailAccount/User.php

Replace line 80:

        $cellView->setTemplate(function(\Nethgui\Renderer\Xhtml $view) use ($self, $view) {

with:

        $viewer = $view;
        $cellView->setTemplate(function(\Nethgui\Renderer\Xhtml $viewer) use ($self, $view) {

A future update could break it, until it is fixed in nethserver-mail-server package.

I think to recall @stephdl wanted to review how to handle httpd-admin php version.


(Stéphane de Labrusse) #8

Or wait after @davidep to fix nethgui issue with php7. Who will be the first


(Davide Principi) #9

Pull requests and QA against regressions are always welcome, but… I don’t like the idea of upgrading Nethgui to PHP 7 and providing backward PHP 5 compatibility, because the official upstream, stable, patched version of PHP is 5.

If some applications require another PHP version in my opinion the correct approach is providing them the necessary infrastructure and isolation (php-fpm? docker?). This prevents breaking other older applications - like server manager.


(Héctor Pérez) #10

Dnutan, It worked all rigth, I have installed the php-scl, but the default PHP version is with the system PHP.

Where to turn off SCL for httpd-admin?.

Thanks a lot.


(Stéphane de Labrusse) #11

It is not currently possible to turn off the php-scl version for http-admin. It is a new feature request you are asking.

What you can do, enable a php-scl version in a vhost and run the webapp inside.

What I could do is to enable php-scl in /var/www but it doesn’t cover the case of rpm with the need of a recent php version. This case will need to drop a specific httpd/cond.d/mySoft.conf to set the php-fpm path


(Rob Bosch) #12

I am running in the exact same error:
I was trying to view the aliasses created for the mail addresses I have, And when I go to Management - email addresses I get:

[64] Cannot use lexical variable $view as a parameter name

See the system log for details.

In var/log/messages I see these entries:

Feb 25 12:10:49 ns7 httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80
Feb 25 12:11:01 ns7 systemd: Created slice User Slice of sogo.
Feb 25 12:11:01 ns7 systemd: Starting User Slice of sogo.
Feb 25 12:11:01 ns7 systemd: Started Session 24815 of user sogo.
Feb 25 12:11:01 ns7 systemd: Starting Session 24815 of user sogo.
Feb 25 12:11:01 ns7 systemd: Removed slice User Slice of sogo.
Feb 25 12:11:01 ns7 systemd: Stopping User Slice of sogo.

Any thoughts?

/edit: applied the quick and dirty fix @dnutan suggested: this seems to work. How can we get this sustainable?


(Stéphane de Labrusse) #13

remove the use of php7-scl for the whole server


(Rob Bosch) #14

I tried to revert to default php, but still had the problem. Or did I have to restart apache for this?

For my use of nethserver on the VPS I need php7(+) because Moodle 3.4 needs at least php7. When trying to install Moodle in /var/www/html, The moodle page is not reachable after initial install and when installing in a vhost, I run into CSS errors… Since installing in a vhost is the only way of choosing another version than the global version for php, I need either the global option fixed or the vhost option fixed… choices choices…


(Marc) #15

Yes, you’ve to restart httpd-admin


(Markus Neuberger) #16

This works without changing PHP for whole server! Port 9071 is for PHP71, you may also use 9070, 9056 or 9000 for default. This way the Email Addresses link in http-admin still works.

Just put this snippet in your apache config file in the Directory directive

<FilesMatch \.php$>
        SetHandler "proxy:fcgi://127.0.0.1:9071"
</FilesMatch>

I tested it with moodle and it works with the php-fpm method (thanks to @davidep) but still not in a Nethserver vhost because of missing CSS. With Joomla we have similar CSS problems in a vhost, see this thread.

I’ll post my moodle.conf in the moodle howto thread.


(Stéphane de Labrusse) #17

I will try to commit some changes but the /etc/httpd/conf/httpd.conf is not a template…I do not test if I can overpass this in conf.d

need tests