![]() Those files are only read once during the startup stage (when you first start apache httpd or php-fpm, for example) and only overridden by runtime configuration changes. Loaded configuration is either your loaded php.ini file or your nf or nf or virtualhost file. Don't hardcode the constant value of E_ALL, because that value is subject to change between different versions of PHP. To avoid a WSOD you want to make sure that your loaded configuration file has display_errors on and error_reporting set to -1 ( this is the equivalent E_ALL because it ensures all bits are turned on regardless of which version of PHP you're running). htaccess, which is a runtime configuration file) then only the default loaded configuration settings are in play. So if you are modifying PHP's display_errors configuration during runtime, (this includes anything from using ini_set in your code to using. ![]() It's important to recognize that a syntax error or parse error happens during the compile or parsing step, which means that PHP will bail before it's even had a chance to execute any of your code. If you have access to php.ini, you can find it under the error_log entry. In shared hosting, it may be in a dedicated folder or on the same folder as the offending script. It fails at compile time, meaning that it'll use the values in php.ini, which if you hadn't changed, may not allow the display of errors. With syntax errors, the script doesn't even get to runtime. That means that the script hadn't even run! That usually happens when you have a syntax error! These two lines will do the same effect as altering the php.ini entries as above! Awesome! I still get a blank page/500 error! In the desired script, we can alter the php.ini entries in runtime! Meaning, it'll run when the script runs! Sweet! error_reporting(E_ALL) But fear not! We have other options! Runtime configuration Usually shared hosts do not allow the alteration of their php.ini file, and so, that option is sadly unavailable. Check! Whoa whoa! No check! I can't change my php.ini! When in doubt, set it to E_ALL to display all the errors. ![]() Check!Įrror_reporting (as of PHP 5.3) is set by default to E_ALL
0 Comments
Leave a Reply. |