Error after upgrading FreePBX Framework 2.11.0.0beta2.6 to 2.8

Seems to install fine…

Please wait while module actions are performed

Downloading framework 2847320 of 2847320 (100%)
Untarring…Done.
installing files to /var/www/html…done
installing files to /var/lib/asterisk/bin…done
installing files to /var/lib/asterisk/agi-bin…done
Checking for upgrades…No further upgrades necessary
framework file install done, removing packages from module
file/directory: /var/www/html/admin/modules/framework/amp_conf removed successfully
file/directory: /var/www/html/admin/modules/framework/upgrades removed successfully
file/directory: /var/www/html/admin/modules/framework/libfreepbx.install.php removed successfully
framework installed successfully

but when you try and apply it, you get the following:

Reload failed because retrieve_conf encountered an error: 255

exit: 255
PHP Parse error: syntax error, unexpected T_FUNCTION in /var/lib/asterisk/bin/retrieve_conf on line 677
1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.

Restoring a backup clears the error, but of course you are back to 2.6 - Has anyone else seen this?

Greg

Working fine here.

You can download the file from: http://www.freepbx.org/trac/export/15456/freepbx/branches/2.11/amp_conf/bin/retrieve_conf

But I advise you do that on a non windows machine

Tried it - Same thing - could be this box is hosed - if I am the only person having the problem, I wouldn’t waste time on it.

Greg

I had the exact same error as GSnover. The PHP code referred to on line 677 appears to only be valid in PHP 5.3.

array_walk_recursive($funclist,
function($a) use (&$functions) { $functions[] = $a; });

I was able to restore the previous version of retrieve_conf to get rid of the error and provide a temp work-around, but I guess the better fix is for me to upgrade from PHP 5.1 to 5.3.

Frank

I am seeing the same error with PHP v5.3?

Reload failed because retrieve_conf encountered an error: 126

I downloaded the retrieve_conf file provided by tm100 above and still get the same issue.

As a temporary workaround, you can replace line 677 with:

<?php $functions = array(); function flat($a) {global $functions; $functions[] = $a; } array_walk_recursive($funclist, 'flat'); ?>

Obviously, this will be overwritten on the next framework update. You really should update to php5.3!

Thanks for this. We are having this same issue and are unable to upgrade from PHP 5.1.6, to 5.3 presently. I want to make sure I understand this workaround and am hoping you can assist.

In our retrieve_conf at line 676 & 677 is:
(Line 676) array_walk_recursive($funclist,
(Line 677) function($a) use (&$functions) { $functions[] = $a; });

Are you saying to do this?
(Line 676) array_walk_recursive($funclist,
(Line 677) <?php
(Line 678) $functions = array();
(Line 679) function flat($a) {global $functions; $functions[] = (Line 680) $a; }
(Line 681) array_walk_recursive($funclist, ‘flat’);
(Line 682) ?>

Please forgive the noob question, don’t work in PHP very often… Thank you!

@psynosis - if your not comfortable in php, DO NOT use this work around. If php53 is not available to you, restore your pbx from a backup and stay on FreePBX 2.10 for the time being.

We went ahead and changed this in the latest FreePBX Framework to play nice with PHP 5.1 and 5.2 but long term I suggest you get updated to 5.3 for support reasons.

We upgraded the framework and are back up. We’ll schedule the upgrade to 5.3. Thank you!