Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6981987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:13:44+00:00 2026-05-27T18:13:44+00:00

Is there a PHP function or some other way of obtaining the PHP error

  • 0

Is there a PHP function or some other way of obtaining the PHP error log as a string?

I need this because I cannot access the error log of a site I am running on someone else’s server. – He offered to email me the error log, but that isn’t exactly convenient.

Is there some way I could output the error log to a PHP page?


I realize that viewing the entire server’s error log is not really going to happen for me. However, I know you can do something like this to email a manual error_log call to yourself:

error_log('A really bad error', 3, 'me@myemail.com');

Is it possible to configure a page to email errors to you instead of displaying them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:13:45+00:00Added an answer on May 27, 2026 at 6:13 pm

    On a badly secured server, yes. But on most servers there are two users: apache and [ you ]. You don’t have access to the server logs, since they are owned by the apache user (or whichever server you’re using).

    However, you could probably try it:

    echo file_get_contents('/var/log/httpd/error_log');
    

    Note: that’s the default location on a RedHat-based apache server. It may be different

    Update To reflect the updated question
    No, you cannot view the error log with error_log – it is a one-way process that gets handled by the webserver. It only writes the log, but you cannot read it.

    You can probably display the errors with this:

    ini_set('display_errors', 'On');
    error_reporting(E_ALL);
    

    You could even use set_error_handler to handle all warnings and notices (for example, to mail them). But that’s pretty much all you can do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there php function to remove the space inside the string? for example: $abcd=this
In PHP, is there any way to make class method automatically call some other
Is there a Php function to determine if a string consist of only ASCII
Is there a PHP function that grabs the string in between two characters. For
Is there a PHP string function that transforms a multi-line string into a single-line
I have this function that puts some data with Ajax call in a php
I heard that in PHP there are some alternatives for the functions substr() and
Is there a php function that someone can use to automatically detect if an
Is there a php function to handle the encodings below? .replaceAll(\u00c3\u0080, À) .replaceAll(\u00c3\u0081, Á)
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.