[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Trixbox PHP Error

Posted on 2008-10-14
18
Medium Priority
?
1,329 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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 2000 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

[Video] Oticon Case Study

Open office environments can create the dynamics for innovation, but they also bring some challenges. With over 1,000 employees in an open office, Oticon needed a solution that would preserve the environment while mitigating disruptive background noises.

Watch how they did it.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Suggested Courses

650 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