Cannot turn error messaging on
Moderator: General Moderators
Cannot turn error messaging on
I had someone write a php script for me, but it kept coming up with an error, so he turned errors off. Great. Like if there is a warning light indicating some problem, turn off the light. Problem solved. Anyway I can't turn it back on. I don't know what he did to turn it off. I've tried changing the error messaging in php.ini (both in the current directory and in the oringal php directory). I've also tried turning it on in the page script, but to no avail. What next?
and search for @
Code: Select all
// no warnings when $r is not a valid resource
@mysql_fetch_array($r)
// supresses _all_ warnings when executing yadda.php
@include 'yadda.php';Shoot the person who wrote it
What a good idea. I am based in Thailand at the moment and guns are plentiful. People shoot each other regularly, even over things trivial. One can get someone shot for as little as $100. But I think I'll let him off this time.feyd wrote:Step 2, shoot the person that wrote it.
Code included
In the php.ini file, the active error directives are
The htaccess files are new to me. I searched on all files on my hard disc and all the htaccess files were not accessible and had not been modified for a number of years.
All of my php scripts are affected.
Code: Select all
error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = on
track_errors = On
html_errors = OnAll of my php scripts are affected.
Errors forgotten
I only briefly saw the errors that came up, before this chap made changes and don't remember what they were. I have just managed to speak to him on the phone. It's difficult because he is Thai with little English and I speak English knowing even less Thai. And at best he can be described as a 'man of few words'. But from the broken converstion it appears that he did change something in the php.ini file.
I have just noticed that in the phpMyAdmin, from the php information, where it shows the configuration settings for php Core, that display errors is turned off, both local and master. Does this indicate the present settings on my machine, or is it a reference guide?
I have just noticed that in the phpMyAdmin, from the php information, where it shows the configuration settings for php Core, that display errors is turned off, both local and master. Does this indicate the present settings on my machine, or is it a reference guide?
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Is it logging errors to a file? Look for errors.txt or something similar.
If you can't find one, paste this and run it alone:
If you can't find one, paste this and run it alone:
Code: Select all
lets_debug($this_damn_problem){
this is soooo totally invalid!
}- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Run the following in a new file please. You don't need to show us the results, but you can use it to compare where your edited php.ini is and where php is reading it from. It will also tell you where your errors are being reported to.
After confirming you are editing the correct php.ini, you can set error_reporting to E_ALL.
Code: Select all
<?php
$eol = (php_sapi_name() == 'cli' ? "\n" : "<br />\n");
echo 'Config path: ', get_cfg_var('cfg_file_path'), $eol;
echo 'Error log: ', get_cfg_var('error_log'), $eol;
?>and while you're at it you can also setIf one of these functions is called in the script you will get a warning: function 'xyz' is disabled for security reasons on line N in path/to/file. Just in case the report level is changed within the script.
see http://de3.php.net/manual/en/features.s ... -functions
Code: Select all
disable_functions = error_reporting,ini_setsee http://de3.php.net/manual/en/features.s ... -functions
It worked.
It worked. Thanks. When I ran the script to show the location of the configuration file it came up with
I had been looking on the web for a script that might tell me the present configuration settings, or the location of the used configuration file, but could not find anything, so thanks for supplying one.
This little creature in the windows directory had eluded me and I still don't know why. I had performed a search on the hard drive for any file called 'php.ini' and only ones in the /php directory, the root directory and the more local directories came up in the search results. The one in the windows directory did not show. All the files look identical so I am baffled. Anyway, I'm happy and can now get on with some work.
Code: Select all
C:\WINDOWS\php.iniThis little creature in the windows directory had eluded me and I still don't know why. I had performed a search on the hard drive for any file called 'php.ini' and only ones in the /php directory, the root directory and the more local directories came up in the search results. The one in the windows directory did not show. All the files look identical so I am baffled. Anyway, I'm happy and can now get on with some work.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US