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


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:

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.