Solved

Trixbox PHP Error

Posted on 2008-10-14
18
1,310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
embadded search engine in website 4 46
PHP-MSSQL 2016 connection requirements for Windows 2012 29 76
http response code 3 35
Insert PHP into HTML page. 7 49
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

739 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