php, ajax error reporting is not working - php

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.

Related

codeigniter blank page, no errors or logs

I was working on an existing project of codeigniter 3.0.1 and I must have change something somewhere that I dont find who broke the site. Everything was working before and now I get a blank page with no errors and no logs at all...
I have added the code to the index.php to display error and still nothing
error_reporting(E_ALL);
ini_set('display_errors', 'On');
I then started to put some echo to see where i reached... Index reach to
require_once BASEPATH.'core/CodeIgniter.php';
system/core/CodeIgniter.php reach to
$EXT =& load_class('Hooks', 'core');
system/core/Hooks.php reach to
$CFG =& load_class('Config', 'core');
And then nothing can be echo from /system/core/Config.php within the constructor. I can still echo from before the class definition.
I picked a fresh copy of that file to be sure it's good and still same.
Can anyone help me identify the issue or point me out some ideas, I am not so used to CI. Thanks in advance
The problem was an error in a php syntaxe in some page. I post this answer because of the way I ended up troubleshooting it... For some reason, I was totally unable to get the error messages from anywhere (log or php_error) even with the error_reporting or the ini_set() even if i placed it mostly everywhere even the page where the error was.
The problem about no error reporting came from the php config that I didnt had acces to, but I managed to downgrade the php version from 7 to 5.6 and errors showed up letting me find the file with bad php syntaxe.
Hope that might help someone

PHP errors in browser not showing (using Docker)

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);

PHP stops executing with no error

I'm administering a system used by around 100 users. Everything is working fine except for one user. When that user logs in, the source will only output about 70 lines og html and then just stop executing. PHP show no errors whatsoever, and nothing is shown in the error log. Errors is enabled in the script.
If i remove some lines, in the html, it will execute more PHP, but then still stop at about 70 lines in the source code.
This, as I said, only happens for one user.
Does anyone have an idea about what could be going wrong here?
if error is not displaying it means the error display or error reporting is off in php.ini you can turn it on by the following php functions
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
?>
place above functions in the starting of your file and it will output error if any occurs.

Zend Framework doesn't show errors

Every error that happens in the server is not shown to me... I tried checking the requisitions in Firebug, but everytime when there is an error, the response fails.
Only "Internal Server Error 500" is displayed.
I think I am missing some concepts... can someone help me, please?
Thanks
You should keep in mind that in development environment you should turn on error display and set your error reporting level to E_ALL.
just write these two lines in your code or in your init() function
error_reporting(E_ALL);
ini_set('display_errors', true);

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