简体   繁体   中英

PHP display_errors=Off in php.ini settings issue

I have a custom php.ini file I created in my public_html directory. It works as I have checked the settings set are correct using phpinfo().

But the strange problem is the php.ini settings do not seem to apply to all sub_folders in the public_html directory?

Any ideas perhaps theres a setting needed in php.ini to apply to all subdirectories in public_html?

I found the answer myself you have to add the line into .htaccess file so it uses the custom php.ini file you created in public_html instead of having to copy php.ini file in every subdirectory you create.

Add this to .htaccess does the trick obviously replacing username

SetEnv PHPRC /home/USERNAME/public_html/php.ini

Not really a solution, but you can disable overriding the display_error setting by using php_admin_flag in your sites configuration. If it still happens then, you have set an error handler which misbehaves.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM