nethesis / dev

Nethesis issue tracker
http://www.nethesis.it
4 stars 1 forks source link

NethVoice14: agi fails with FreePBX framework 14.0.3.2 #5406

Closed alepolidori closed 6 years ago

alepolidori commented 6 years ago

all ours php scripts and AGI load FreePBX environment (mainly for DB queries) by including /etc/freepbx.conf that isn't a configuration file but is a php that do stuff. All scripts and AGI uses system PHP (5.4) instead of SCL (5.6)

Steps to reproduce

Expected behavior

Actual behavior

PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php on line 90
Whoops\Exception\ErrorException: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in file /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php on line 90
Stack trace:
  1. Whoops\Exception\ErrorException->() /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php:90

All agi and scripts that include this file withouth calling proper php version has the same problem.

Components AGI has been fixed calling env php. asterisk env will have php scl path (see changes in nethserver-freepbx) AGI:

Actions:

Others:

alepolidori commented 6 years ago

test

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

nethbot commented 6 years ago

in 7.4.1708/nethesis-upgrades:

nethbot commented 6 years ago

in 7.4.1708/nethesis-upgrades:

Stell0 commented 6 years ago

nethserver-nethvoice14-14.1.13-1.ns7.noarch.rpm patch FreePBX framework and now is possible to include /etc/freepbx.conf in programs launched with PHP 5.4 without errors. This temporary solve this bug.

Stell0 commented 6 years ago

How to test: nethserver-nethvoice14-14.1.13-1.ns7.noarch.rpm patch the framework to avoid the error. By itself it is enough to temporary fix the issue, but also with it isn't easy to understand if correct version of PHP is used. So, for testing, revert the patch with following command, answering 'y' when it ask to reverse:

 # /usr/bin/patch -p0 /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php < /usr/src/nethvoice/5406.patch

patching file /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php
Reversed (or previously applied) patch detected!  Assume -R? [n] y

now you can verify that loading /etc/freepbx.conf fails with php 5.4

# php /etc/freepbx.conf 
PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php on line 90
Whoops\Exception\ErrorException: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in file /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php on line 90
Stack trace:
  1. Whoops\Exception\ErrorException->() /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php:90

test AGI from neth-hotel

CTI Actions - fresh install NethCTI

test nethserver-phonebook-mysql scripts on NethVoice 11 and NethVoice14 update packages and wait for cron to execute phonebook sync (or change cron script time, but let cron launch the script to check environment)

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

Stell0 commented 6 years ago

Test: "check how to test" Pay attention to errors on debug and that AGI really works, because using PHP 5.6 instead of 5.4 could broke something

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

nethbot commented 6 years ago

in 7.4.1708/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-upgrades:

nethbot commented 6 years ago

in 7.5.1804/nethesis-upgrades:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-upgrades:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-testing:

nethbot commented 6 years ago

in 7.5.1804/nethesis-upgrades:

Stell0 commented 6 years ago

in 7.5.1804/nethesis-upgrades: