Modules broken in module admin and permission denied for retrieve.conf file

I am using ubuntu 8.04 LTS and install asterisk and all depended packages through repos. asterisk 1.4.17. I downloaded freepbx-2.51., untar and ./install_amp with no problems.

in etc/amportal.conf, change location var/www/html and var/www/html/panel to new locations. noticed some of the /admin file permissions needed to be different

in freepbx admin, I am getting these errors

1/
exit: 126sh: /var/lib/asterisk/bin/retrieve_conf: Permission denied
1 error(s) occured, you should view the notification log on the dashboard or main screen to check for more details.

note: it is 775

2/
Critical: You have 9 broken modules
The following modules are disabled because they are broken:
recordings, infoservices, core, framework, music, dashboard, featurecodeadmin, customappsreg, voicemail

You should go to the module admin page to fix these

note: I tried but would not work. it said “This module is broken and cannot be installed. You should try to download it again.”

3/ php values need to be changed in .htaccess file
where should I put the .htacces file? /admin?

I found out one answer /modules/ all the directories need to be 775. It seems to be my file permissions are causing most of the problems.

Now that my modules are not broken. I cannot seen to upgrade of add on new ones. one example “Error opening /var/www/pbx/admin/modules/_cache/core-2.5.1.4.tgz for writing”. my _cache directory is 775 but there are no files in it.