I'm currently getting the following errors when using PHP via command line and on PHPMyAdmin.
Command line error
PHPMyAdmin error
What's the easiest way to disable these errors? The command line errors don't make sense because all them work correctly.
When I navigate to the directory where it's saying it doesn't exist, it's .so version of them not .dll.
Tried disabling them in php.ini but didn't do anything.
The accepted solution is wrong. It will turn off all error reporting in PHP and that's not intended?
The best way to turn off Phpmyadmin errors is to go go config.inc.php and set (or comment out ie removing the // lines in front of the value, which is set to "ask" by default.)
$cfg['SendErrorReports'] = 'never';
Hit save and that's it.
More info
https://docs.phpmyadmin.net/en/latest/config.html#cfg_SendErrorReports
From your command line screenshot it can be seen that you have unix path and windows .dll - it is a nonsense. You need to look at your php.ini and fix either extension_dir or extension entries.
For phpMyAdmin errors you need to edit error_reporting into your php.ini to e.g. E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
Related
Does anyone know what needs to be done for the terminal to display exceptions thrown by the PHP code? At the moment when I trigger for instance php index.php I don't get anything even though the code within the index.php file fires the exception.
I have all error logging set to true in my php.ini (running with Mamp).
You need to have these lines uncommented in your default php.ini:
error_reporting = E_ALL
display_errors = On
I am trying to get PHP errors to display on the screen using IIS vrs 8.5 and PHP vrs 5.2.17, but I continue to get the IIS 500 error http page, or a blank screen. I have already found numerous SO posts that have supposed fixes, but nothing on them has fixed my problem yet. Here is what I have tried.
Changed errorMode to Detailed. Still getting the 500 error page instead of the php error.
Removed all of the custom errors in the default IIS config file under the "httpErrors" block. Still getting the IIS custom 500 error page.
Added existingResponse="PassThrough" to my httpErrors block in the default IIS config. Doing this causes me to get a blank page instead of the php error, or the IIS 500 error.
I have verified that none of these settings are being overwritten in the site default system.config files.
Currently I am getting a blank page instead of the IIS 500 error on the screen. I have already verified that display_errors is on, and error_reporting is correct. I also know that the php page runs just fine. I am purposely causing this php error by removing a semi-colon on the page. So I already know everything is working fine. PHP Error logging is also working, but I want the errors to display on the page so I dont have to look at the error log every 5 minutes.
What else could be causing this?
IF you set custom error to Detailed in feature settings of error pages for website and server both
AND if in your php.ini file you set the display_errors = on & error_reporting = E_ALL
THEN there is only one possibility for getting [IIS default 500 error page] is that "Your PHP is not working coz of miss configuration."
The required configurations are:
After setting Handler Mappings to your php-cgi.exe file(which is in you php installation dir) as FastCGI, open the php.ini file and edit following lines OR add if not found in file. (if php.ini is not exists in you PHP installation dir then rename from existing php.ini-development OR php.ini-production)
1) extension_dir = "ext\"
;ext folder will be in PHP installation, if not create and don't forget ending \
2) log_errors = On
3) error_log = "C:\inetpub\temp\php-errors.log"
4) cgi.force_redirect = 0
; may be you need to add this line add it anywhere, for instance-before '; File Uploads ;'
5) cgi.fix_pathinfo = 1
6) fastcgi.impersonate = 1
7) fastcgi.logging = 0
Be careful and there should not `;` before any of these lines.
see documentation - installing/configuring PHP
Even after correct configurations PHP may not work because of system corruption. You can check by double click on php-cgi.exe and php-win.exe it should run without proper error (other then warnings OR ext/fileName... is missing messages - these are OK).
Note: after these many other setting are requires to run all things of php (ex. session), but by these SIMPLE PHP WILL WORK or PHP will properly show the error for what's wrong (NOT 500 page).
Make sure you are editing the right php.ini file. To check which file needs to be edited, go to IIS > Handler Mappings and look for PHP. Then check which directory they are located in.
In my case, I had two directories and was editing the wrong php.ini file, which was the reason why I was unable to get the errors to display.
I was having a similar issue getting a 500 error instead of a PHP error. I fixed the issue by going to PHP Manager within IIS
Under PHP Settings click configure error reporting. This will allow you to choose between Development and Production machine. If you choose Production you will get no detailed PHP errors in the browser, you will only get wrritten to a logfile. Development will allow for both errors to be displayed and written to a logfile.
I hope this helps.
If ou are Getting error 500 when active php to show errors, maybe you need to turn off the tracking error
Follow the step by step to fix.
If you don't have downnload the PHP Manager for IIS, you can find it in Web Platform Installer. Then open it.
After that click on manage all settings
Now Just turn off this setting
under server configuration feature view you see fast-cgi settings,
double click it. you see php-cgi.exe. double click it. set standart error mode to IgnoreAndReturn200.
regards
I was struggling with this issue - I have my PHP Handler Mapping set as follows, confirming I'm using PHP 5.3:
Therefore I then went to the corresponding location to find the correct file, here: C:\Program Files (x86)\PHP\v5.3 and edited php.ini
At first it looked like this:
; error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
I changed it to this:
error_reporting(E_ALL);
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
I had to restart the Server in IIS to apply the change (choosing the Server from the list at the top on the left hand side, rather than selecting the Site on the left, lower down):
Now I see the error message - e.g.
Parse error: syntax error, unexpected '=' in C:\data\test.php on line 2
Instead of this type of generic error - e.g. on Chrome:
I'm trying to see what error PHP is producing. So I've changed the value of dispaly_errors to ON in the etc/php5/apache2/php.ini file.
The file doesn't display anything and I don't see any error on the webpages.
Am I missing any thing?
First, you have to make sure that this is your correct ini file. Usually the file you have used is the correct one. If not sure, you can create a simple PHP program to call the phpinfo() function and check this out.
Next, you have to restart Apache. Without a restart your settings don't take effect.
Another thing... This file can be a little misleading because there are so many comments in it. The actual line to change is way down. On my setup (LAMP/Ubuntu) the setting is on line 538.
Open php.ini file from your php folder, remove semicolon from all error reporting like
;error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT, ;display_errors=On etc, at last, restart your server, you will find all error messages.
Another way for showing error, you can write these codes in your script -
echo '<pre>';
error_reporting(E_ALL);
ini_set('display_errors', 1);
In addition to enabling display_errors, you may also need to set the error reporting level. if you are expecting errors with a script that is redirecting, be sure to turn off the redirection or you may never see them.
I just installed xampp, getting errors all over the place. Want to get rid of error handling. It's only annoying errors to do with my variables.
I'm not sure where to find php.ini, it doesn't exist in my C:\xampp\apache
Inside your php.ini make sure that you have display_errors to Off. From what I understand if you set display_errors to Off then the error_reporting directive doesn't need to change.
Example:
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
in php.ini, do the following change,
display_errors = Off
This is very old now, but in case someone comes across this there's a XAMMP issue with version 5.6.3. I had the same issue with error display set to 'off' and it was still showing up as on in phpinfo()
For some reason, they added the error reporting in php.ini twice. display_errors shows on line 99 of php.ini, and then again on line 552.
So if you scroll down and disable the first one, the second one is still set to 'on' and overrides the first one leaving error reporting active.
I'm sure this will be fixed with future versions of XAMMP, but wanted to add this here for anyone that comes here looking for an answer to this problem.
If you set display_errors=off then all types of error will of.
But if you only want to notice error off the you can set
error_reporting = E_ALL & ~E_NOTICE
Xampp and other web applications have an error interface to show programmers (and users) execution errors or warnings (notices).
In order to modify the way Xampp shows errors you have to go control panel and open php.ini.
Inside this file you can find two points to modify the way it shows errors:
“display_errors = On”. From my point of view it has to be On all the time. If you put Off you won’t have any info regarding bad sentences.
“error_reporting=E_ALL”. This is the key point. Changing the value of it you can change the way it shows errors.
Inside php.ini is documented all options. My favorites:
error_reporting=E_ALL it shows everything. Good for debug.
error_reporting=E_ALL & ~E_STRICT & ~E_DEPRECATED it shows errors & notice (very important for debugging) and not shows suggestions & deprecated functions in next php versions.
error_reporting=E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED production environment not including Notices.
I hope this fit for you.
More details https://community.apachefriends.org/f/viewtopic.php?f=17&t=50989
i have done onw project in php. It works on my windows pc. I use xampp on my windows machine.But when i devlopy same on my linux machine it shows me some blank pages.
Some pages are completely blank.some are half blank.
whats the problem?
Those blank pages could be because there is an error that is not displayed -- will be hard to guess what, though, so here are a couple of pointers :
Did you check if there is anything useful in your Apache's log files (something like /var/log/apache/error.log, or close to that, generally).
You can also enable display_errors and/or configure error_reporting, to get more informations -- or have them displayed on screen, which might be a bit easier, as long as you are developping and your application is not deployed to the production server.
This can be done in the php.ini file, if you can modify it, with something like this :
error_reporting = E_ALL | E_STRICT
display_errors = On
html_errors = On
Or it can also be done directly in your code, at the beginning of it, with something like this :
error_reporting(E_ALL);
ini_set('display_errors', 'On');
To enable error_reporting for all kinf of errors, and display those errors.
You might also want to install Xdebug on your development box, to get nice stacktraces when an error / exception occurs -- just don't install it on a production server !
Of course, on your production machine, you probably don't want to display errors ; so that will have to be configured depending on your environment ;-)