PHP errors in browser not showing (using Docker) - php

I am a beginner in PHP and have a problem. My browser is not showing the errors from a PHP file. It only says This page isn’t working 127.0.0.1 is currently unable to handle this request.HTTP ERROR 500. I want the errors to be displayed(like a notice). I am using Docker. I have searched everywhere and don't know what to do. Please help.
p.s Also I can not find my php.ini file. Tried putting this code in the PHP file , but still it doesn't work
error_reporting(E_ALL);
error_reporting(-1);
ini_set('error_reporting', E_ALL);

Related

HTTP ERROR 500 when installing magento

"The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500"
This is the error message my browser displayed.
I don't know why, I installed Magento on Windows and there was no problem, but when I install it on my Ubuntu, my browser say that, please help me and thank you for the help.
An error 500 is an error on the server side.
Maybe you have a typo in your code which makes it break.
As you tried it on Windows, it could come from this as well, as Windows is not case sensitive with files, and ubuntu is.
You should try looking at the server logs to have more information.
Or else put those lines in your index.php, it should show you the errors and help you debugging it (there is a developper mode you can enable in Magento but I prefere adding all those lines to get more informations) :
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

PHP errors not being displayed although they are "on" in the php.ini file

I am on OpenSUSE, I've installed PHP, when I test a simple PHP code, it works, but once I'm trying to display a PHP code that has errors, I get the following error :
The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
I have changed the value of display_errors to on in the php.ini file, I have also tried all solutions I could find but I still do get that message instead of the actual errors in my PHP file.
I have also added the following lines on the beginning of my PHP file but it didn't solve the problem :
ini_set('display_errors', 1);
error_reporting(~0);

AMPPS not displaying errors?

I looked PHP.ini files but error mode is on there?
But when there is error in my code I cannot see php showing error??
I use local host called AMPPS.
And whenever there is error i see blank page like if i use:
require('something.php');
There is a blank page instead of showing fatal error or warnings.
I use CodeCanyon script. Can script change the error showing mode?
How can I display all there error even if it is small on as I am on development mode.
Can script change the error showing mode?
Yes, it can. For starters you can set this in your PHP file—before code like require('something.php');—to force errors to show:
error_reporting(E_ALL);
ini_set('display_errors', 1);
But that said, if errors are not displayed at all, check your Apache logs in your setup. Unclear on where in AMPPS the logs would be stored—or what your host system running AMPPS is—but there should be a log in there somewhere.

php, ajax error reporting is not working

i have this file and on a click event it calls a php function through $.post{}
i have used alert(data) to recognized errors. But unfortunately its not allerting anything except it shows an error on firebug console with relevant url "Internal server error 500" and then i tried to access the code through browser pasting the full url, I have put error_reporting(E_ALL);
ini_set("display_errors", 1); , but shows a blank page. I'm lost here no idea how to solve this without any errors displaying.. Help much appreciated.
p.s in php info error reporting is off. i tried htaccess on my subfolder without no luck either.
Make sure of the following:
error_reporting(E_ALL) is right after <?php tag
There is indeed a PHP error - try to deliberately make one. Maybe the error is elsewhere, not your PHP but the .htaccess file (since you're getting 500), or maybe it's a logical error.

PHP website does not work, and nothing logged in the error log

I have a problem with PHP. There is an error that I have never encountered before. The home.php, which is the main page of my site, cannot be viewed. And there is nothing in error log. After there is an inclusion of a php page (a class that is a part of my API). Till that line the holl HTML (javascript and css inclusions) are echoed from php and successfully rendered in browser, but after the php kind of stops suddenly. When I delete that line(php page inclusion line), website works, but before, this inclusion didn't make any problem for me. I removed the code parts which after them I encountered this problem, but nothing works.
I am using Apache2, PHP5 with Ubuntu 11.10.
Any help will be appreciated, thanks in advance.
My first hints would be to check the following:
In your script set ini_set('display_errors', '1'); and error_reporting(E_ALL); to display all errors.
Turn on the php error log and check it for errors.
run php -l home.php on the command line to check your php file for syntax errors.
Check Apache's error log, sometimes error messages go there.
If nothing helps use a debbugger like XDebug to see where the script terminates, or alternative insert statements like die("here"); and move them around in your code, to see which parts of your scripts are passed.
Greetings and good luck.

Categories