Newbie Error Code Question
Newbie Error Code Question
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.
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
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.
-
- Site Admin
- Posts: 157
- Joined: Wed Jan 20, 2021 3:06 am
Re: Newbie Error Code Question
Can you share your PHP error log?
MAMP Support Forums is an unofficial support forum covering MAMP & MAMP Pro solution stacks.
Re: Newbie Error Code Question
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
Thanks for your response.
David
Re: Newbie Error Code Question
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.......
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.......
Last edited by howedav on Tue May 04, 2021 6:11 pm, edited 1 time in total.