500 server error

After adding Sys Admin module I now get a 500 server error
freepbx 2.10 Asterisk 1.8
2 year old AsteriskNOW install updated to current
Sys Admin dependencies met using yum

This seemed like a good idea to try … here is the output:

[[email protected] freepbx-2.10.0beta2]# amportal start

PHP Fatal error: Call to undefined function posix_getpwuid() in /var/lib/asteri
sk/bin/gen_amp_conf.php on line 3
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.
[[email protected] freepbx-2.10.0beta2]#

Any ideas… things were going so good!!!

Any ideas? Calls are still routing correctly but the WebUI is dead.

asternic cdr installed?

I found I had to rm -rf asternic_cdr

“locate asternic_cdr” yielded no results

Seems to have something to do with my php update

/var/lib/asterisk/bin/module_admin reload

Error(s) have occured, the following is the retrieve_conf output:
exit: 255
PHP Fatal error: Incompatible file format: The encoded file has format major ID 3, whereas the Loader expects 4 in /var/www/html/admin/modules/callerid/functions.inc/functions.inc.php on line 0
You have new mail in /var/spool/mail/root

Can anyone tell me how to restore via ssh?


The original thread was about an error in gen_amp_conf.php on line 3

You can either edit this file, and comment out the first 4 lines - viz:

<?php // $current_user = posix_getpwuid(posix_geteuid()); // if ($current_user['uid'] !== 0) { // die('Forbidden - must be root'); // } Or Better still, simply install the correct PHP components: yum install php-posix Fixed mine no worries Andy

I am having a similar issue after running the upgrade tool from version 2.9 to version 2.10. I do have Asterisk 1.8 installed.

After installing the new FreePbx Framework from the 2.10 repository as per the Module Admin instructions I get:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.3 (CentOS) Server at pbx.check-flight.com Port 6730"

Of course this means I cannot get into the FreePbx web GUI nor complete the upgrade of other modules.

I have run “yum install php-posix” successfully, but it hasn’t helped.

Also # /var/lib/asterisk/bin/module_admin reload

results in: -bash: module_admin: command not found

module_admin does exist in the bin directory.

I’ve done an amportal restart with no apparent problems and even a restart of the entire server, but the error remains.
The Apache Error Log shows:

[Sun Mar 11 15:26:14 2012] [alert] [client] /var/www/html/admin/.htaccess: deny not allowed here, referer:

So this looks like it might be an authentication problem, but I have no idea what to do about it.

The content of the .htaccess file is:

# Disallow all file access first

<FilesMatch “…*$”>
Deny from all

Now allow /admin, /admin/config.php and /admin/index.php as well as the various assets

<FilesMatch “(^$|index.php|config.php|.(gif|GIF|jpg|jpeg|png|css|js|swf|txt|ico)$)”>
Allow from all

I changed that to Allow from all in the first instance and I STILL get an authentication error, although subtly different:

The Apache Error Log shows:

[Sun Mar 11 15:36:04 2012] [alert] [client] /var/www/html/admin/.htaccess: allow not allowed here, referer:

Very odd. I don’t know where to go from here. Could it be a misconfiguration of the module that handles htaccess files?

Okay, through trial and error, (more error than anything), since my post above I have managed to get access to the web gui by simply renaming all of the .htaccess files to htaccess.bak in the following directories:


However, I don’t really know what I’m doing so am a bit concerned this might leave a gaping hole in the apache security.

Also, even having worked around the “Internal Server Error 500” message, the FOP is just coming up Error 404, the page cannot be found. This might be an older problem from a version 2.8-2.9 upgrade which broke the FOP. Amportal Restart shows that FOP seems to start just fine, but I can’t get to it from either of the URLs.

I would really appreciate any further thoughts on this.

Cheers :slight_smile:

I found this email from “cron” hope it gives someone a clue. I lost the webgui 7 months ago and haven’t been able to get it back since then. just by updating using YUM. anyway here is what I found:

PHP Warning: file_put_contents(/var/log/asterisk/freepbx_debug): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 628
PHP Fatal error: require_once(): Failed opening required ‘DB.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/html/admin/libraries/db_connect.php on line 14

Hope this helps. all my lines calls and connections still work but there is no way for me to access and make any changes or updates.

MrDREllis, you did not tell us anything about your system or why you used yum to update so nothing we can do to help without more info.

Most people get hung up on the PHP and Zend requirements for v2.10

SkykingOH, Check top of the thread… posts in January and February. I am the originator of this thread.

FYI, that is correct it the problem started after yum update of php and zend to meet the requirements for Sys Admin.

there is more detail in the posts from January and Feb. I believe I had just upgraded to 2.10 through module admin web gui and was trying to yum update to meet the pre-req for Sys admin. this was an AsteriskNow install from late 2009 and had never had a problem til the php update.