for my local machine i'm using the following setting in my php.ini
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
it allows omitting single quotes for fetching data from a recordset like $rs[url]
.
i've also used this setting on my webserver, but it simply ignores the syntax above and won't fetch any data. what could be wrong?
The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); The ini_set function will try to override the configuration found in your php.
To turn off or disable error reporting in PHP, set the value to zero. For example, use the code snippet: <? php error_reporting(0); ?>
The ini_set(“log_errors”, TRUE) command can be added to the php script to enable error logging in php. The ini_set('error_log', $log_file) command can be added to the php script to set the error logging file. Further error_log($error_message) function call can be used to log error message to the given file.
Are you sure you modified the right php.ini?
I ask that because sometimes, php.ini is located on various path, one for the php cli, the other for apache (and probably the case for other web server).
You should add more details about what server do you use (windows, linux), and which webserver are you using (apache, nginx, etc).
You should also be searching "php.ini" in your file system, maybe there is more than one file and you modified the wrong one, resulting in the problem you have.
Finally, and as mentionned in the comments, you shouldn't remove the deprecated errors and the notice in development environment, and have a "no error" code because an update is quite easy to make, and any deprecated function now, could result in a non working code after a quick apt-get update
(for debian users).
Of course in production, you should hide all errors, but show a nice 404 or 500 page to your users and log the error for later investigation. :)
I am using Xdebug & Zend Framework 2
In my development environment I have mine set to:
error_reporting = E_ALL & ~E_USER_DEPRECATED & ~E_STRICT
I have found this to be my favoured setting when using ZF2.
If you're using PHP-FPM
& NGINX The php.ini
file is normally in found /etc/php5/fpm/
.
Alternatively if you're using Apache with the PHP module, your php.ini
file is normally in /etc/php5/
That error reporting level works for me as it I have found Zend Framework can throw some notices that are not relevant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With