Solved

Trixbox PHP Error

Posted on 2008-10-14
18
1,297 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

914 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

14 Experts available now in Live!

Get 1:1 Help Now