Forum Moderators: coopster

Message Too Old, No Replies

Viewing Raw Logs

         

xcrashorx

3:54 am on May 6, 2009 (gmt 0)

10+ Year Member



Was wondering if anyone could tell me what I messed up here. The following code is inside log.php and every time I would go to the link I would see a continues page of logs to the site as they happened. THEN (lol) I may have screwed up something in my php.ini or something because now when I load it, it just sits there and won't feed any info to the browser. This was really handy now it kind of sucks not having it work. Thanks in advance for any help or suggestions.

<html>
<head>
<title>Realtime Raw Logs</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="left">
<strong>
<?php
system("date");
?>
</strong>
<br>
<br>
<?php
echo '<pre>';
$last_line = system('wc -l /var/www/DIR TO SITE ¦ sort -u', $retval);
echo '
</pre>
<hr />Last line of the output: ' . $last_line . ' ' ;
?>
<br>
<?php
echo '<pre>';
$last_line = system('tail -f /var/www/DIR TO SITE ', $retval);
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
?>
</div>
</body>
</html>

coopster

5:57 pm on May 9, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You likely no longer have permission to run the system() command because of a safe_mode setting violation or something. Check your error logs for messages.

On a side note, I hope you have this page secured some how so that only you can access the script. It really isn't a good idea to have this in the publicly accessible area. As a matter of fact, why even use html and php to view the logs? Connect via secure tunnel and run your system commands using secure shell access.

xcrashorx

6:27 am on May 10, 2009 (gmt 0)

10+ Year Member



Awesome thanks i will look into this and the link is behind a password dir, with a dtrong password. That should be good enough correct? Thanks for the help.

xcrashorx

5:42 am on May 11, 2009 (gmt 0)

10+ Year Member



Hmm these were the recent changes made, do you know which one would do it?

safe_mode = off
open_basedir = (no value)
output_buffering = on
register_argc_argv = On
max_execution_time = 1000
session.gc_maxlifetime = 15000
upload_max_filesize = 100M
post_max_size = 100M
register_globals = off

xcrashorx

7:21 am on May 11, 2009 (gmt 0)

10+ Year Member



Ok i can't find anything in the logs, but i started to trouble shoot the log.php file and everything seems to EXECUTE (not work how it should yet) with out the following line.
$last_line = system('tail -f /var/www/vhosts/website/access_log', $retval);

So brings me to assume its waiting to long for this output.
So would it be one of these?

output_buffering = on
max_execution_time = 1000
session.gc_maxlifetime = 15000

xcrashorx

7:33 am on May 11, 2009 (gmt 0)

10+ Year Member



Haaa fixed it by changeing
output_buffering = Off
max_execution_time = 0

Was it both that did it?
Thanks

coopster

1:27 pm on May 11, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Make one change at a time and test -- then you'll be able to tell.