我的共享托管服务拒绝在PHP.ini中查看PHP中的错误。
因此,我想编写自己的php.ini文件,并将其放在自己的子目录中。这可能吗?
我试过这个教程,但没有用
http://www.washington.edu/itconnect/web/publishing/php-ini.html#create
PHP只是不在我的目录中查找PHP.ini文件。它仍然坚持/etc/php5/cgi/php.ini中的那个。
您可以尝试使用.htaccess文件来启用错误日志记录/报告。
.htaccess
# enable PHP error logging
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log
您可以使用ini_set
来设置给定配置选项的值。
确保在系统php.ini中有以下设置可以启用用户定义的ini文件:
;;;;;;;;;;;;;;;;;;;;
; php.ini Options ;
;;;;;;;;;;;;;;;;;;;;
; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
user_ini.filename = ".user.ini"
; To disable this feature set this option to empty value
;user_ini.filename =