0

I am learning PHP using VS and am using apache server. When there is an error that I know is an error, my browser just shows a blank screen instead of describing the error. How can I set it to do so? Thanks

I have tried searching 'error' in settings and ensuring all of the error settings seem correct.

Joe
  • 21
  • 3
  • Does this answer your question? [How do I get PHP errors to display?](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – Jim G. Jan 30 '23 at 22:02

2 Answers2

1

On a Mac having downloaded XAMPP:

Applications/XAMMP/xamppfiles/etc/'php.ini'

Line 471: display_errors = On

OS Ventura 13.2

Joe
  • 21
  • 3
0

Look for your PHP installation folder should be something like this: /bin/php/php-8.1.13-Win32-vs16-x64 When you find it, look for: php.ini and look for this text (and set it to On):

display_errors = On
error_reporting = E_ALL

then save the file and restart the server.

If you don't find this file or do not want to edit it, try to add this at the top of your PHP file:

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

//Start your php code here

This should be enough in order to display all errors.

Alexandro Giles
  • 497
  • 5
  • 18
  • the second occurance of 'display_erros' was set to off. that solved my problem. thank you. i am on a mac, so the php file came up as just 'php.ini'. – Joe Jan 28 '23 at 14:19