Luke Warm Posted February 23, 2011 Share Posted February 23, 2011 Hey gang, Is there any way to view the apache error.log file in PHP? Link to comment https://forums.phpfreaks.com/topic/228635-viewing-error-logs-in-php/ Share on other sites More sharing options...
kenrbnsn Posted February 23, 2011 Share Posted February 23, 2011 If you have read privs to the file, yes. Ken Link to comment https://forums.phpfreaks.com/topic/228635-viewing-error-logs-in-php/#findComment-1178834 Share on other sites More sharing options...
Luke Warm Posted February 23, 2011 Author Share Posted February 23, 2011 I do. So far I've tried: <?php include('includes/error.log'); ?> Nothing. Link to comment https://forums.phpfreaks.com/topic/228635-viewing-error-logs-in-php/#findComment-1178835 Share on other sites More sharing options...
BlueSkyIS Posted February 23, 2011 Share Posted February 23, 2011 is your apache error log kept in ./includes/error.log? probably not, so you'll need to update the path to the actual path to the error log. not sure your PHP is going to allow that, but give it a try. Link to comment https://forums.phpfreaks.com/topic/228635-viewing-error-logs-in-php/#findComment-1178899 Share on other sites More sharing options...
kenrbnsn Posted February 24, 2011 Share Posted February 24, 2011 Using include will probably give you errors, since PHP is going to try to interpret the log file entries as PHP code. You probably want to read the file and display the lines. If you tell us what you're trying to do in more detail, we could help you better. Ken Link to comment https://forums.phpfreaks.com/topic/228635-viewing-error-logs-in-php/#findComment-1178967 Share on other sites More sharing options...
Luke Warm Posted February 24, 2011 Author Share Posted February 24, 2011 I have an application I've written that allows me to create, drop databases, add tables, fields,etc. I want to be able to view the error.log in a textarea (or whatever) within the application to keep track of Apache. Link to comment https://forums.phpfreaks.com/topic/228635-viewing-error-logs-in-php/#findComment-1179053 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.