Error on retrieve_conf: FATAL ERROR DB Error: extension not found

Hi,

I have installed freepbx on synology NAS with asterisk 1.8.
I have modified various scripts, synology uses a busybox linux, and finally freepbx is installed.
I can login to admin site and it monitors ssh, web server, mysql and asterisk, I can create trunks, extensions and any other things, but I have a problem when I click on “Apply config” button.
When I click I have an error:

FATAL ERROR
DB Error: extension not found
Trace Back
/volume1/web/freepbx/admin/libraries/db_connect.php:63 die_freepbx()
[0]: DB Error: extension not found

/volume1/web/freepbx/admin/bootstrap.php:98 require_once()
[0]: /volume1/web/freepbx/admin/libraries/db_connect.php

/etc/freepbx.conf:9 require_once()
[0]: /volume1/web/freepbx/admin/bootstrap.php

/volume1/web/freepbx/admin/config.php:97 include_once()
[0]: /etc/freepbx.conf

In console, I can execute /var/lib/asterisk/bin/retrieve_conf as root and it works, but when I execute sudo -u nobody /var/lib/asterisk/bin/retrieve_conf (the user not is asterisk, is nobody) returns the same error.

I have modified the user and group to nobody on asterisk and freepbx directories and now I don’t know how to fix the problem.
I have search on the forum, but I don’t find any solution to fix the problem.
Oh, I have installed pear and pear DB.

Any ideas?

Thanks a lot.

Your apache user needs access to the asterisk user’s home directory, either run both asterisk and your web server under the same user or edit your /etc/sudoers with visudo to allow such access.

Hi,
Thanks for the reply.
The apache user & group are nobody/nobody and I have modify all the asterisk directories (I think) to nobody/nobody.
Asterisk and apache are executed as nobody user.

DiskStation> ps | grep nobody
1203 root 4076 S grep nobody
30785 nobody 51688 S /opt/sbin/asterisk -U nobody -G nobody -vvvg
31615 nobody 65932 S /usr/syno/apache/bin/httpd -DSSL -DHAVE_PHP
31616 nobody 65260 S /usr/syno/apache/bin/httpd -DSSL -DHAVE_PHP
31617 nobody 65260 S /usr/syno/apache/bin/httpd -DSSL -DHAVE_PHP
32501 nobody 65260 S /usr/syno/apache/bin/httpd -DSSL -DHAVE_PHP

I have detected that when I execute retrieve_conf with sudo -u nobody the mysql extension is not load (I have modified db_connect.php), but when I execute as root it works.

Usually “nobody” has no home directory and not a lot of access to anything, for good reason, asterisk’s home directory is /var/lib/asterisk so it has access to the bin/ directory, the apache user does not, you also probably don’t want to mess with the nobody user, just keep within the users of the processes you are concerned about and try with asterisk as the owner of apache and asterisk.