Solved

Trixbox PHP Error

Posted on 2008-10-14
18
1,295 Views
Last Modified: 2013-12-13
My Trixbox is working ok, but not perfectly. it is functonal and everything is working but the php web interface gives the error bellow, among other PHP errors. Also today my status is this today:
SSH ServerWarn
Op PanelWarn

--> Here are some of the PHP errors i get in the web portal. help appreciated

Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not a valid IPv4 or IPv6 address in /var/www/html/maint/modules/home/includes/os/class.Linux.inc.php on line 68

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/maint/modules/home/includes/os/class.Linux.inc.php:68) in /var/www/html/maint/modules/home/includes/system_header.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/maint/modules/home/includes/os/class.Linux.inc.php:68) in /var/www/html/maint/modules/home/includes/system_header.php on line 32
0
Comment
Question by:mxrider_420
18 Comments
 
LVL 19

Expert Comment

by:http:// thevpn.guru
Comment Utility
Well those are warnings that you can ignore,  you can reduce the php warn level and you want see them anymore, however it is bothering that you got those right out of a installed trixbox.
Did you do any modifications to the code ?
0
 
LVL 1

Author Comment

by:mxrider_420
Comment Utility
How can i make them hidden? And yes its bothering me because the OS Panel doesnt display at all without error, and the header on the top looks so much different now.. like its weird its not displaying propperly. I didnt change any PHP config stuff not sure why this happened. only thing i changed was the manager password and changed it back to default 'amp111' to be on the safe side. It used to be working perfectly. still is, well not the OP Panel but most everything else works but every page has a PHP error of some kind
0
 
LVL 1

Author Comment

by:mxrider_420
Comment Utility
This is a weird one.. is there any PHP pros out there? Or Trixbox pros?
0
 
LVL 1

Author Comment

by:mxrider_420
Comment Utility
anyone got any ideas yet?.... thanks
0
 
LVL 13

Expert Comment

by:Xyptilon2
Comment Utility
You can turn off error_reporting in PHP with

error_reporting(0);
See: http://cn.php.net/manual/en/function.error-reporting.php
Or you can set error reporting in your php.ini file.

However, that may not be desired. The last 2 errors are the result of the first error. They occur when a cookie is being written and output has already started (in this case the output is the first error).

As for the first error, this occurs when PHP cannot read the IP address. This may happen if (for example when using $_SERVER[HTTP_REFERER] or $_SERVER[REMOTE_ADDR] it returns more than 1 IP address. To resolve this issue, you can extract the first IP address from whatever variable you are trying to read:

if (strstr($remoteIP, ', ')) {
    $ips = explode(', ', $remoteIP);
    $remoteIP = $ips[0];
}

Is it extracting a IPv4 or IPv6 address?
0
 
LVL 1

Author Comment

by:mxrider_420
Comment Utility
v4, and i have no idea why its trying to do that either. and where would i put that code? im a NooB
0
 
LVL 13

Expert Comment

by:Xyptilon2
Comment Utility
That's a bit hard to say from here...the fastest way to turn of error reporting is to create a file called ".htaccess" (without the quotes) and place the following line in it:

php_value error_reporting 0

Place this file in your /www/ directory. It should disable error reporting for PHP unless the script overrides this again.

As for the other code, if you cannot or dont want to disable error reporting, this will most likely have to be placed around line 68 off the following file:

/var/www/html/maint/modules/home/includes/os/class.Linux.inc.php

Please not that, variabele names may need to be changed depending on the situation at hand, i cannot see that from here unfortunately.

Goodluck!
0
 
LVL 1

Author Comment

by:mxrider_420
Comment Utility
where is that? htaccess?
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 13

Expert Comment

by:Xyptilon2
Comment Utility
you can upload a file to your webhost called a.htaccess and then rename it to .htaccess (without the a). The file will become hidden in your FTP client.

Alternatively, you can place error_reporting(); in the top of your php page in /var/www/html/maint/modules/home/includes/os/class.Linux.inc.php
0
 
LVL 1

Author Comment

by:mxrider_420
Comment Utility
well all these are fine to stop the messages but i think im just going to reload. my OS Panel says Warn so does my SSH server. these are major issues and nothign displays right. i think these options must be fixed correctly or else i might run into issues witha  patch fix later on. im going to reload
0
 
LVL 1

Expert Comment

by:Vee_Mod
Comment Utility
This question needs to be 'deleted', not closed with an indicated solution.
0
 
LVL 13

Accepted Solution

by:
Xyptilon2 earned 500 total points
Comment Utility
Not that i care about the points, but the question has been answered, the error messages comes from a double ip address. The PHP function gethostbyaddr cannot handle that. So either fix that in the source code by stripping additional ip addresses or surpress the warning / error messages.
0
 
LVL 1

Author Closing Comment

by:mxrider_420
Comment Utility
good communication
0
 

Expert Comment

by:Malchion
Comment Utility
I had the exact same errors, found a solution that worked for me. I pulled this from another EE page:

MadShiva:In the network setup page on trixbox under "system" tab then "network"

put a dot com at the end and it resolved the issue.

Best Regards
0
 

Expert Comment

by:imagex
Comment Utility
I set my dns to opendns and that fixed the same problem on my system.
0
 
LVL 6

Expert Comment

by:Thomas Wheeler
Comment Utility
I know this post is old but in relation to Malchion's post if it is an internal server say trixbox1.localhost you should change this to trixbox1.localhost.localdomain

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
The viewer will learn how to count occurrences of each item in an array.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now