Page 1 of 1

Newbie Error Code Question

Posted: Thu Apr 08, 2021 1:27 pm
by howedav
Hi,
On a Mac with just installed MAMP trying to learn php. When I make a minor error, say forget the closing ; I get a general error:

This page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500

Not sure where to go to generate more specific errors.
Tried adding some ini_set commands to set error_reporting(E_ALL) at the beginning of my first practice file with no Joy.
Do I need an htaccess file or what.
Everything was installed by defaults and error free code works fine.

Re: Newbie Error Code Question

Posted: Wed Apr 21, 2021 6:29 pm
by howedav
As of this moment I see 35 people have looked at this issue but none has offered any suggestions. For the moment whenever I get an error I upload to a server in the cloud and get the errors reported OK. This is not ideal and so if someone could point me in the right direction I would very much appreciate it.

Re: Newbie Error Code Question

Posted: Thu Apr 22, 2021 10:41 am
by mampsupportmod
Can you share your PHP error log?

Re: Newbie Error Code Question

Posted: Wed Apr 28, 2021 1:05 pm
by howedav
Where do I find this PHP error log. No errors are reporting to the screen when I run the code.
Thanks for your response.
David

Re: Newbie Error Code Question

Posted: Tue May 04, 2021 6:06 pm
by howedav
Finally did another search for this issue. Basically the MAMP supplied php.ini file comes with display_errors defaulted to Off.
One needs to find it and change it to On.
On my Mac, which took the default installation, it is located at:
Applications/MAMP/bin/php/php7.4.12/conf/php.ini
where the php version you are running can be found with phpinfo() and may differ from mine.
It seems this file has moved around quite a bit with the different versions.
Once the value is changed to ON be sure to cycle the MAMP server with STOP then START.
Now to keep learning PHP....... :mrgreen: