0

I run Centos 7, FreeRADIUS 3.0.4, PHP 5.4.16, httpd Apache/2.4.6.

I can log into the Daloradius login screen and then get ERROR 500 on the browser on the ../daloradius/dologin.php page.

Errors in the php log:

[Fri Apr 07 15:59:48.455964 2017] [:error] [pid 2145] [client 154.66.144.101:53132] PHP Warning:  include_once(DB.php): failed to open stream: No such file or directory in /var/www/html/daloradius/library/opendb.php on line 84, referer: http://server/daloradius/login.php
[Fri Apr 07 15:59:48.456091 2017] [:error] [pid 2145] [client 154.66.144.101:53132] PHP Warning:  include_once(): Failed opening 'DB.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/daloradius/library/opendb.php on line 84, referer: http://server/daloradius/login.php
[Fri Apr 07 15:59:48.456241 2017] [:error] [pid 2145] [client 154.66.144.101:53132] PHP Fatal error:  Class 'DB' not found in /var/www/html/daloradius/library/opendb.php on line 86, referer: http://server/daloradius/login.php

"server" is just a placeholder for our real FQDN.

I read that the fix is to install Pear DB, but it is depricated so I installed MDB2 and its MySQLi driver.

Please assist in a solution, I am very new to this system..

EEAA
  • 108,414
  • 18
  • 172
  • 242
Shawn Gradwell
  • 188
  • 1
  • 3
  • 10
  • 2
    You can't just install some random thing and hope it works. You'll need to install Pear DB, which I suspect was not deprecated back when DaloRADIUS's last version was released. Alternatively you'll need to find a newer RADIUS management tool. – DerfK Apr 07 '17 at 20:32
  • Thanks for the advice DerfK. The documentation on Pear DB explained to use MDB2 instead because it is the replacement. I will post the findings if I get it to work or move on. – Shawn Gradwell Apr 08 '17 at 17:31
  • Resolving to install the complete DaloRADIUS image (including OS, PHP etc.) so it will work out of the box. – Shawn Gradwell Apr 10 '17 at 07:56
  • Be careful with the image, it's probably missing at least three years of security patches, and updating it may break things. – tlum Apr 19 '17 at 22:28

2 Answers2

0

Yea, daloRADIUS has not been maintained. Anything that's part of your security infrastructure needs constant attention. You really want to seriously consider if you want to rely on a package that's ostensibly dead. If you are not a coder and capable of owning 100% maintenance of your own fork of the codebase there is no way on earth I would recommend you ever consider using it for anything mission critical.

Yes, DB is deprecated - although I believe they are still doing security patches on it to support legacy installs ... even MDB2 seems unnecessary given native php functionality these days. But, since I didn't want to rewrite the whole DAL, I figured MDB2 was probably the path of least resistance. This is what it took to migrate DB => MDB2.

First you need to install the MDB2 classes:

shell> pear install MDB2
shell> pear install MDB2_Driver_mysql

Then you have to patch the source to actually use it:

shell> cd /your/daloradius/root
shell> find ./ -type f -exec sed -i 's/DB.php/MDB2.php/g' {} \;

Then you have to patch the source to account for some differences between DB and MDB2:

shell> find ./ -type f -exec sed -i 's/$dbSocket->escapeSimple/$dbSocket->escape/g' {} \;
shell> find ./ -type f -exec sed -i 's/DB_FETCHMODE_ASSOC/MDB2_FETCHMODE_ASSOC/g' {} \;
shell> find ./ -type f -exec sed -i 's/$dbSocket->getOne/$dbSocket->queryOne/g' {} \;
shell> find ./ -type f -exec sed -i 's/$dbSocket->getCol/$dbSocket->queryCol/g' {} \;
shell> sed -i "s/MDB2::connect\x28\x24dbConnectString/MDB2::connect\x28\x24dbConnectString, array\x28\'result_buffering\' => true, \'portability\' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_FIX_CASE\x29/g" library/opendb.php

I have tested most functionality and I'm not aware of any issues, though it's possible I missed something since I don't use the billing functionality. I noticed some preexisting warnings in the log relating to timezone, but otherwise it looks clean.

Be very careful with these commands, they have the potential of being very destructive if they are not typed/copied correctly or get run in the wrong directory.

tlum
  • 257
  • 1
  • 8
0

I had similar mistake, centos 7, daloradius-0.9-9. I made next

yum install php-pear php-pear-DB

Now all Ok