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

  • SEARCH
  • Home
  • 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 7963211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:33:44+00:00 2026-06-04T05:33:44+00:00

given the following script <?php ini_set(‘display_errors’,’On’); error_reporting(E_ALL); thisisanerror ?> I get the expected Notice:

  • 0

given the following script

<?php

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

thisisanerror

?>

I get the expected

Notice: Use of undefined constant error - assumed 'error' in /htdocs/test.php on line 8

but if I add something to the script

<?php

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

error

function test () {

    echo('test');

}

?>

I get

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Why am I getting a 500 error instead of a normal syntax error in the latter case? Shouldn’t display_errors always display the error?

  • 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-06-04T05:33:45+00:00Added an answer on June 4, 2026 at 5:33 am

    The second code sample is an outright syntax error. This means PHP will not progress to the point of code execution and will die at parse time. Since no code is executed, the effects of the ini_set() call are not seen, so you do not get the PHP textual error indicating the problem.

    A parse error is fatal, and the web server is (rightly) set to handle PHP fatal errors with a 500 response code. Since your PHP script did not produce any output the web server will return it’s default error document for the 500 condition.

    If you want to see the textual message for parse errors in the browser – and one wouldn’t normally do this is production, by the way – you will need to turn error reporting on in php.ini or using a .htaccess file.

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

Sidebar

Related Questions

I use the following datepicker.php page for jquery datepicker is given below: <!DOCTYPE html>
I use the following query (in a PHP script) SELECT *, (SELECT head FROM
Given the following html table and script shown below I am having a problem
The mysqltuner.pl script gives me the following recommendation: query_cache_limit (> 1M, or use smaller
Given the following example (using JUnit with Hamcrest matchers): Map<String, Class<? extends Serializable>> expected
I can't seem to get my php script to send email. <?php echo Does
I'm trying to get a PHP script to run every 30 minutes on my
I am writing a script in PHP to get data from the twitter API,
Warning: Parameter 3 to showBlogSection() expected to be a reference, value given in /home/smartsta/public_html/includes/Cache/Lite/Function.php
I am trying to Fill in a PDF from PHP script. I am following

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.