retrieve_conf - syntax error

So I am recieving the following error with FreePBX 2.5.1.0 and AsteriskNow 1.5.0 Beta2, Asterisk 1.4.23.1

Error #1 - Logging in to FreePbx Web Portal
Reload failed because retrieve_conf encountered an error: 1
(freepbx.RCONFFAIL)

Error #2 - After adding a user and clicking apply
Retrieve conf failed to copy file(s) from a module’s agi-bin dir: chmod(): Operation not permitted
chmod(): Operation not permitted
chmod(): Operation not permitted
chmod(): Operation not permitted
chmod(): Operation not permitted
chmod(): Operation not permitted
chmod(): Operation not permitted
chmod(): Operation not permitted
(retrieve_conf.CPAGIBIN)

After some research, I executed the retrieve_conf and it returne the following error:

[[email protected] bin]# sh retrieve_conf
retrieve_conf: line 5: syntax error near unexpected token "_"' retrieve_conf: line 5:if (! function_exists("_")) {’

Opening the file

line 1 #!/usr/bin/ -q
line 2
line 3 </usr/bin/php
line 4
line 5 if (! function_exists("_")) {
line 6 function _($str) {
line 7 return $str;
line 8 }
line 9 }


Anyone with any thoughts on how to fix this?

it’s a little strange that you are getting the syntax error about the “if function_exists(”_")…" line as that should be perfectly fine. As far as your chmod errors, try doing the following:

  1. go into your http configuration file and set the apache user to asterisk
  2. run “amportal chown” from the command line (as user root)

upon doing those, your chmod errors should go away.

On step 1, what path and file name are you referring to? /etc/php.ini?
Which setting?

Thanks.

rentzminger,

Your “http configuration file” is httpd.conf. It should be at /etc/httpd/conf/ .
you need to check and possibly edit the User setting.

Would the group also need to be changed?

User/Group: The name (or #number) of the user/group to run httpd as.

. On SCO (ODT 3) use “User nouser” and “Group nogroup”.

. On HPUX you may not be able to use shared memory as nobody, and the

suggested workaround is to create a user www and use that user.

NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)

when the value of (unsigned)Group is above 60000;

don’t use Group #-1 on these systems!

#User apache
User asterisk
Group apache

Thanks.

yes

So I made the changes you suggested but am still receiving the same syntax errors associated with line 5.

When I login to the freepbx web portal I still don’t see the extensions and trunks configured. The retrieve_conf file still fails.