Email Addresses link Doesn't work

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.

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

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

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

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

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

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.

5 Likes

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

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.

2 Likes

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.

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

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?

remove the use of php7-scl for the whole server

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…

Yes, you’ve to restart httpd-admin

1 Like

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.

2 Likes

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

Hi, I set up a nethserver some years ago and don’t very often load-up the gui - i just use it as an email server. On loading the port 980 gui, I find that I also have this “[64] Cannot use lexical variable $view as a parameter name” error.

Email clients such as outlook and the one on win 10 have continued to work, however, if I try to log in to these email accounts using roundcube or webtop running on the nethserver, the log in fails. Re-installing the roundcube and webtop services via the gui doesn’t fix this problem.

My enquiry doesn’t seem to be critical as I can still access the emails via outlook, however, I’m just curious if this is a problem that is stable or if it might at some time just completely lock me out of my emails.

Basically, I’m the sort of person who might well have a cheap old car but I’d like that cheap old car to function and be as reliable as it can possibly be!

Hi,

i drive a thirty year old car (small car from Stuttgart) and make sure myself that everything is always ok and the car is always ready to drive. When the car has trouble, I always look in the error memory first. On the server, this is called a log file or event log. What error information is stored there?

Regards…

Uwe

Many thanks for your reply - and continuing the analogy!
When I’m looking at the workings of my cheap old car, I don’t recognise what some of the spinning bits and uppy-downy bits are doing! Similarly, I’m not sure which of the many system logs that there appears to be will be the most use - and for how far back I should give a quote…

Here is a recent passage from my /var/log/messages file :

Feb 6 17:21:58 kayak esmith::event[19003]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.928895]
Feb 6 17:21:58 kayak systemd: Reloading.
Feb 6 17:22:00 kayak FireQOS[19292]: Cleared all QOS on all interfaces
Feb 6 17:22:00 kayak FireQOS[19319]: QoS applied ok (0 tc commands applied)
Feb 6 17:22:00 kayak root: Shorewall reloaded
Feb 6 17:22:00 kayak esmith::event[19003]: [NOTICE] Shorewall restart
Feb 6 17:22:00 kayak esmith::event[19003]: Action: /etc/e-smith/events/nethserver-firewall-base-save/S89nethserver-shorewall-restart SUCCESS [2.444129]
Feb 6 17:22:01 kayak systemd: Reloading.
Feb 6 17:22:01 kayak esmith::event[19003]: [INFO] service lsm is disabled: skipped
Feb 6 17:22:01 kayak systemd: Reloading.
Feb 6 17:22:01 kayak esmith::event[19003]: [INFO] service fail2ban restart
Feb 6 17:22:01 kayak systemd: Stopping Fail2Ban Service…
Feb 6 17:22:02 kayak fail2ban-client: Shutdown successful
Feb 6 17:22:02 kayak systemd: Stopped Fail2Ban Service.
Feb 6 17:22:02 kayak systemd: Starting Fail2Ban Service…
Feb 6 17:22:02 kayak systemd: Started Fail2Ban Service.
Feb 6 17:22:02 kayak esmith::event[19003]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [1.404678]
Feb 6 17:22:02 kayak esmith::event[19003]: Event: nethserver-firewall-base-save SUCCESS
Feb 6 17:22:02 kayak esmith::event[19002]: Action: /etc/e-smith/events/firewall-adjust/S20firewall-adjust SUCCESS [5.207306]
Feb 6 17:22:02 kayak esmith::event[19002]: Event: firewall-adjust SUCCESS
Feb 6 17:22:03 kayak fail2ban-server: Server ready
Feb 6 17:25:43 kayak httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80
Feb 6 18:10:37 kayak systemd: Starting Cockpit Web Service…
Feb 6 18:10:37 kayak remotectl: /usr/bin/chcon: can’t apply partial context to unlabeled file ‘/etc/cockpit/ws-certs.d/99-nethserver.cert’
Feb 6 18:10:37 kayak remotectl: remotectl: couldn’t change SELinux type context ‘etc_t’ for certificate: /etc/cockpit/ws-certs.d/99-nethserver.cert: Child process exited with code 1
Feb 6 18:10:37 kayak systemd: Started Cockpit Web Service.
Feb 6 18:10:37 kayak cockpit-ws: Using certificate: /etc/cockpit/ws-certs.d/99-nethserver.cert
Feb 6 18:10:37 kayak cockpit-ws: couldn’t read from connection: Peer failed to perform TLS handshake
Feb 6 18:21:54 kayak httpd: [NOTICE] Nethgui\Utility\Session: regenerate session id
Feb 6 18:25:45 kayak httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80
Feb 6 20:13:12 kayak httpd: [NOTICE] Nethgui\Utility\Session: Session terminated after 3600 seconds of inactivity
Feb 6 20:13:24 kayak httpd: [NOTICE] Nethgui\Authorization\User: user root authenticated
Feb 6 20:13:32 kayak httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80
[root@kayak log]#