Call to undefined function random_int() in /var/www/fusionpbx/resources/functions.php on line 2083

Status
Not open for further replies.
Feb 18, 2017
44
7
8
63
I tried to login to my system and was greeted by this:

Call to undefined function random_int() in /var/www/fusionpbx/resources/functions.php on line 2083

I think I did an update the other day, but didn't login after the update.

Where do I start looking?

Thanks,
Scott
 

markjcrane

Active Member
Staff member
Jul 22, 2018
509
180
43
50
This means you are running an old version of PHP 5. This PHP function became available on PHP 7. To accommodate people that are on outdated versions of PHP I added a function when random_int function doesn't exist to mimic this function. That was done yesterday or the day before so that people with old versions would still work. So all you have to do is update FusionPBX source code again and this will work. Then you should plan on getting to a new version of PHP 7.1 or 7.3.

Also when updating please see this note that I added today.
https://www.pbxforums.com/threads/updating-source-git-issue.4026/
 
Feb 18, 2017
44
7
8
63
Thanks Mark! I remember you saying something at Cont Ed the other day, but I did not connect the two. This is a Debian 8 system that I have not updated Linux wise in quite a while. Should I do apt update then apt upgrade? I am planning on migrating to a Debian 9 system,maybe this is the time to do it.

If I do that, installing fresh and restoring the data backup, is it as simple as that?
 

fusionpbxuser888

New Member
Jan 6, 2018
18
0
1
54
Thanks Mark! I remember you saying something at Cont Ed the other day, but I did not connect the two. This is a Debian 8 system that I have not updated Linux wise in quite a while. Should I do apt update then apt upgrade? I am planning on migrating to a Debian 9 system,maybe this is the time to do it.

If I do that, installing fresh and restoring the data backup, is it as simple as that?

It wasn't for me! Use caution.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,074
577
113
Thanks Mark! I remember you saying something at Cont Ed the other day, but I did not connect the two. This is a Debian 8 system that I have not updated Linux wise in quite a while. Should I do apt update then apt upgrade? I am planning on migrating to a Debian 9 system,maybe this is the time to do it.

If I do that, installing fresh and restoring the data backup, is it as simple as that?

Why are you not going to Debian 10?
 

markjcrane

Active Member
Staff member
Jul 22, 2018
509
180
43
50
Thanks Mark! I remember you saying something at Cont Ed the other day, but I did not connect the two. This is a Debian 8 system that I have not updated Linux wise in quite a while. Should I do apt update then apt upgrade? I am planning on migrating to a Debian 9 system,maybe this is the time to do it.

If I do that, installing fresh and restoring the data backup, is it as simple as that?

Need to copy all files across as well. Configuration is stored in the database but not files that are associated with the customers need to be copied over to the new server.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,074
577
113
Also, just for info, I upgraded a bdr cluster last night from Debian Jessie and Freeswitch 1.6.20 to Debian Buster and the latest Freeswitch. I haven't touched FusionPBX yet. All appears to be working well and the only thing needed for freeswitch was adding the pgsql moidule and the new preload file in the autoload_configs. Obviously apt sources needs changing. I went form Jessie to Stretch to Buster. Fail2ban will fail to start due to jail.conf. Just back that up first and then touch the jail.conf with an empty file, that will allow the upgrades to complete.
 
Feb 18, 2017
44
7
8
63
Ok, I updated to php7.1 manually by following the php install script on github.

I rebooted the server, but still get the Fatal error: Call to undefined function random_int() in /var/www/fusionpbx/resources/functions.php on line 2083

Is there something else I need to update as well? When I do: php --version, I get 7.1.33
 

markjcrane

Active Member
Staff member
Jul 22, 2018
509
180
43
50
Ok, I updated to php7.1 manually by following the php install script on github.

I rebooted the server, but still get the Fatal error: Call to undefined function random_int() in /var/www/fusionpbx/resources/functions.php on line 2083

Is there something else I need to update as well? When I do: php --version, I get 7.1.33

My guess your nginx is still using PHP 5 as PHP 7 definitely does have this function.
https://www.php.net/random_int
 
Status
Not open for further replies.