Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Get back some good info on your server (http://www.greenguysboard.com/board/showthread.php?t=25295)

juggernaut 2005-10-23 10:44 PM

Get back some good info on your server
 
If you are paying for hosting and wondering about info on box you are hosted on heres some cool code for you

<<<---START BELOW HERE--->>>


ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();

preg_match_all('/#[0-9a-fA-F]{6}/', $phpinfo, $rawmatches);
for ($i = 0; $i < count($rawmatches[0]); $i++)
$matches[] = $rawmatches[0][$i];
$matches = array_unique($matches);

$hexvalue = '0123456789abcdef';

$j = 0;
foreach ($matches as $match)
{

$r = '#';
$searches[$j] = $match;
for ($i = 0; $i < 6; $i++)
$r .= substr($hexvalue, mt_rand(0, 15), 1);
$replacements[$j++] = $r;
unset($r);
}

for ($i = 0; $i < count($searches); $i++)
$phpinfo = str_replace($searches, $replacements, $phpinfo);
echo $phpinfo;
<---END HERE--->

Take this code, copy an paste it into notepad, save the file as anything you like example "whatsgoingon.php"
up load it to a directory on your server and run it. IE if you place it in a directory called www.yourdomain.com/php
then you would type this in your browser
www.yourdomain.com/php/whatsgoingon.php

I got this from the php website today. The only thing I dont like about it is it outputs a whole bunch of wakky colors and you have to keep refreashing to find one you can read. But it is a nice thing, as like me I found out today my host had a very old version of php and this could be causing issues with my site.. Hope this helps, jugg..

cd34 2005-10-24 01:09 AM

you could do

Code:

phpinfo();
?>

:)

juggernaut 2005-10-24 01:37 AM

Right. I have that one also but that will only tell you the version, nothing more. Try this out it gives you a whole bunch of shit. All the enabled options your host has on the software etc. BTW, cd34 just the man I needed to ask something. I dont have much exp with Linux boxes and installing php. Any idea what would give a 400 Bad Request error? I have some users signing up at my site complaining that after they enter a validation code they still get an error message stating wrong user name and password. The only thing I can find looking threw the logs and crossing with their ip is that error. Thanks Jugg..

cd34 2005-10-24 03:28 AM

Well, then something is seriously wrong somewhere.

The script you have runs ob_start(), then does phpinfo(), then does ob_end_clean() -- all you have done is capture the output from phpinfo() which is then processed with random colors. The output you get from phpinfo() or the script you have posted should be no different. I did test both before posting and after your reply. Except for colors, I get identical information.

As for the error 400, you'd need to give a little more info out of the error.log file. 401 would be invalid user/pass which would be much more likely. a 400 error would suggest a proxy server or something inbetween having a problem moreso than a user. Are you behind a load balancer or caching forwarder? Is it a php request that gives the error? or any request?

Give me a little more info and I'll see if I can help. Might be a few days to get back to you as the winds are picking up. :)

juggernaut 2005-10-24 12:21 PM

Quote:

Originally Posted by cd34
Well, then something is seriously wrong somewhere.

The script you have runs ob_start(), then does phpinfo(), then does ob_end_clean() -- all you have done is capture the output from phpinfo() which is then processed with random colors. The output you get from phpinfo() or the script you have posted should be no different. I did test both before posting and after your reply. Except for colors, I get identical information.

My 2nd code was only giving me the numbered version of php.. This code you have here is much better. Same stuff, just its able to be read lol. I love doing little things like this.

Quote:

Originally Posted by cd34
As for the error 400, you'd need to give a little more info out of the error.log file. 401 would be invalid user/pass which would be much more likely. a 400 error would suggest a proxy server or something inbetween having a problem moreso than a user. Are you behind a load balancer or caching forwarder? Is it a php request that gives the error? or any request?

Give me a little more info and I'll see if I can help. Might be a few days to get back to you as the winds are picking up. :)

Ill send over the info when I get it. I have the hosting company logging any of the errors, but this is something that happens maybe once a week or so. I'm starting to think you are correct in it being a proxy issue. I have noticed that not many surfers are signing up with aol addys. and we do sometimes have issues with people who sign up with hotmail addys. But I think the hot mail might be people who are using msn as there provider cause about 95% of them are able to sign up. I dont see many issues with anyone else. Some people over seas but I could give a fuck about them as I know some guy in Africa is not going to be buying any shows from the girls, more just wasting their time. But once I get more info on it Ill let you know cause I would feel much better knowing 100% a possible reason. Looked over the logs from last night and there is nothing, but then again no one had any issues signing up last night. Thanks Jugg..


All times are GMT -4. The time now is 12:11 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc