Solved

Trixbox PHP Error

Posted on 2008-10-14
18
1,305 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
ID: 22718531
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
ID: 22722442
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
ID: 22727535
This is a weird one.. is there any PHP pros out there? Or Trixbox pros?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 1

Author Comment

by:mxrider_420
ID: 22745820
anyone got any ideas yet?.... thanks
0
 
LVL 13

Expert Comment

by:Xyptilon2
ID: 22754668
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
ID: 22755000
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
ID: 22755016
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
ID: 22758509
where is that? htaccess?
0
 
LVL 13

Expert Comment

by:Xyptilon2
ID: 22758586
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
ID: 22775417
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
ID: 22775536
This question needs to be 'deleted', not closed with an indicated solution.
0
 
LVL 13

Accepted Solution

by:
Xyptilon2 earned 500 total points
ID: 22776917
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
ID: 31506203
good communication
0
 

Expert Comment

by:Malchion
ID: 25097260
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
ID: 25193441
I set my dns to opendns and that fixed the same problem on my system.
0
 
LVL 7

Expert Comment

by:Thomas Wheeler
ID: 31242890
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

679 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