2

I don't get any PHP error, just get a white page on Firefox, and

Server error
The website encountered an error while retrieving http://example.com/pruebas/prov.php. It may be down for maintenance or configured incorrectly

on Chrome.

This is the code:

if (!ini_get('display_errors')) {
   ini_set('display_errors', 1);
}
echo "hola"
echo "hola2";

I intentionally made mistake in the echo "hola" (there's no ';').

I also tried adding to the end of my .htaccess file -> suPHP_ConfigPath /home/username/public_html replacing username with my current username, and then I created a php.ini in public_html with "display_errors = on;". But I'm still not able to get any PHP error.

2
  • 1
    You might be interested to know there's a function that can trigger a Fatal Error instead of leaving off the semicolon: trigger_error. Commented Jun 20, 2011 at 15:41
  • can you access the main php.ini for example mine is located in /etc/php5/apache2/ on my ubuntu machine.? Commented Jun 20, 2011 at 15:45

3 Answers 3

3

Your script is dying due to the syntax error before it ever executes, so the ini_set() call is never executed and never takes effect. You'd have to change the setting in the appropriate php.ini.

The actual error message may be in a log file somewhere. Try Apache's error_log, or see if PHP's logging somewhere else.

Sign up to request clarification or add additional context in comments.

1 Comment

This happens on a web hosting. Theres a error_log on /public_html but i have no content
1

Make sure that you also have the appropriate error_reporting ini value set as well. You can find more information on PHP.net

Set the error reporting level. The parameter is either an integer representing a bit field, or named constants. The error_reporting levels and constants are described in Predefined Constants, and in php.ini. To set at runtime, use the error_reporting() function. See also the display_errors directive.

In PHP 4 and PHP 5 the default value is E_ALL & ~E_NOTICE. This setting does not show E_NOTICE level errors. You may want to show them during development.

Source

1 Comment

error_reporting(E_ALL); ini_set('display_errors','On'); echo "hola" echo "hola2";
0

Make sure the display_errors is set to on on your php.ini file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.