2013-10-20 70 views
0

我試圖使用XAMPP 1.8.3-1時,關閉錯誤報告,但是修改XAMPP的php.ini文件做絕對什麼都沒有。這裏是我的PHP.ini文件,如您所見,我關閉了display_errors並將通知設置爲關閉,但仍然顯示。任何幫助,將不勝感激!關閉錯誤報告XAMPP 1.8.3-1

[PHP] 

;;;;;;;;;;;;;;;;;;; 
; About php.ini ; 
;;;;;;;;;;;;;;;;;;; 
; PHP's initialization file, generally called php.ini, is responsible for 
; configuring many of the aspects of PHP's behavior. 

; PHP attempts to find and load this configuration from a number of locations. 
; The following is a summary of its search order: 
; 1. SAPI module specific location. 
; 2. The PHPRC environment variable. (As of PHP 5.2.0) 
; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) 
; 4. Current working directory (except CLI) 
; 5. The web server's directory (for SAPI modules), or directory of PHP 
; (otherwise in Windows) 
; 6. The directory from the --with-config-file-path compile time option, or the 
; Windows directory (C:\windows or C:\winnt) 
; See the PHP docs for more specific information. 
; http://php.net/configuration.file 

; The syntax of the file is extremely simple. Whitespace and Lines 
; beginning with a semicolon are silently ignored (as you probably guessed). 
; Section headers (e.g. [Foo]) are also silently ignored, even though 
; they might mean something in the future. 

; Directives following the section heading [PATH=/www/mysite] only 
; apply to PHP files in the /www/mysite directory. Directives 
; following the section heading [HOST=www.example.com] only apply to 
; PHP files served from www.example.com. Directives set in these 
; special sections cannot be overridden by user-defined INI files or 
; at runtime. Currently, [PATH=] and [HOST=] sections only work under 
; CGI/FastCGI. 
; http://php.net/ini.sections 

; Directives are specified using the following syntax: 
; directive = value 
; Directive names are *case sensitive* - foo=bar is different from FOO=bar. 
; Directives are variables used to configure PHP or PHP extensions. 
; There is no name validation. If PHP can't find an expected 
; directive because it is not set or is mistyped, a default value will be used. 

; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one 
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression 
; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a 
; previously set variable or directive (e.g. ${foo}) 

; Expressions in the INI file are limited to bitwise operators and parentheses: 
; | bitwise OR 
;^bitwise XOR 
; & bitwise AND 
; ~ bitwise NOT 
; ! boolean NOT 

; Boolean flags can be turned on using the values 1, On, True or Yes. 
; They can be turned off using the values 0, Off, False or No. 

; An empty string can be denoted by simply not writing anything after the equal 
; sign, or by using the None keyword: 

; foo =   ; sets foo to an empty string 
; foo = None ; sets foo to an empty string 
; foo = "None" ; sets foo to the string 'None' 

; If you use constants in your value, and these constants belong to a 
; dynamically loaded extension (either a PHP extension or a Zend extension), 
; you may only use these constants *after* the line that loads the extension. 

;;;;;;;;;;;;;;;;;;; 
; About this file ; 
;;;;;;;;;;;;;;;;;;; 
; PHP comes packaged with two INI files. One that is recommended to be used 
; in production environments and one that is recommended to be used in 
; development environments. 

; php.ini-production contains settings which hold security, performance and 
; best practices at its core. But please be aware, these settings may break 
; compatibility with older or less security conscience applications. We 
; recommending using the production ini in production and testing environments. 

; php.ini-development is very similar to its production variant, except it's 
; much more verbose when it comes to errors. We recommending using the 
; development version only in development environments as errors shown to 
; application users can inadvertently leak otherwise secure information. 

;;;;;;;;;;;;;;;;;;; 
; Quick Reference ; 
;;;;;;;;;;;;;;;;;;; 
; The following are all the settings which are different in either the production 
; or development versions of the INIs with respect to PHP's default behavior. 
; Please see the actual settings later in the document for more details as to why 
; we recommend these changes in PHP's behavior. 

; allow_call_time_pass_reference 
; Default Value: On 
; Development Value: Off 
; Production Value: Off 

; display_errors 
; Default Value: On 
    Development Value: Off 
; Production Value: Off 

; display_startup_errors 
; Default Value: Off 
; Development Value: On 
; Production Value: Off 

; error_reporting 
; Default Value: E_ALL & ~E_NOTICE 
    Development Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 
; Production Value: E_ALL & ~E_DEPRECATED 

; html_errors 
; Default Value: On 
; Development Value: On 
; Production value: Off 

; log_errors 
; Default Value: Off 
; Development Value: On 
; Production Value: On 

; magic_quotes_gpc 
; Default Value: On 
; Development Value: Off 
; Production Value: Off 

; max_input_time 
; Default Value: -1 (Unlimited) 
; Development Value: 60 (60 seconds) 
; Production Value: 60 (60 seconds) 

; output_buffering 
; Default Value: Off 
; Development Value: 4096 
; Production Value: 4096 

; register_argc_argv 
; Default Value: On 
; Development Value: Off 
; Production Value: Off 

; register_long_arrays 
; Default Value: On 
; Development Value: Off 
; Production Value: Off 

; request_order 
; Default Value: None 
; Development Value: "GP" 
; Production Value: "GP" 

; session.bug_compat_42 
; Default Value: On 
; Development Value: On 
; Production Value: Off 

; session.bug_compat_warn 
; Default Value: On 
; Development Value: On 
; Production Value: Off 

; session.gc_divisor 
; Default Value: 100 
; Development Value: 1000 
; Production Value: 1000 

; session.hash_bits_per_character 
; Default Value: 4 
; Development Value: 5 
; Production Value: 5 

; short_open_tag 
; Default Value: On 
; Development Value: Off 
; Production Value: Off 

; track_errors 
; Default Value: Off 
; Development Value: On 
; Production Value: Off 

; url_rewriter.tags 
; Default Value: "a=href,area=href,frame=src,form=,fieldset=" 
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 

; variables_order 
; Default Value: "EGPCS" 
; Development Value: "GPCS" 
; Production Value: "GPCS" 
+0

所有這些線都只是註釋出來,並沒有任何意義。 –

+0

對不起,阿邁爾 - 我的錯誤。我已取消註釋行並仍顯示錯誤。 –

+0

你能檢查你的phpinfo(); ? –

回答

0

創建一個名爲phpinfo.php一個簡單的PHP文件:

<?php phpinfo(); ?> 

運行它,並檢查進入的地方說:Loaded configuration file - 這是負責的配置。如果修改此文件的設置應體現後你重新啓動Apache的 - 在Linux上運行時sudo /opt/lampp/lampp restartapache,在Windows上使用的控制面板。

+0

謝謝 - phpinfo()函數加載正確的php.ini文件,用「的display_errors」標誌設置爲關中的發展模式,但是phpinfo()函數說錯誤開啓。我嘗試了多次重新啓動Apache,但錯誤仍然存​​在。 –

+0

也許你用一些.htaccess指令('php_flag')重寫INI值? – ErnestV

+0

看起來不像它 - 我沒有.htaccess文件。 –

0

好吧,好吧,我似乎已經解決了這個問題,對@ ErnestV的評論進行了一些調整 - 我創建了一個.htaccess文件(之前沒有一個),並將一個php_flag設置爲display_errors off,解決了我的問題。

如果有解決這個更好的方法,我很想知道,但,現在,似乎已經完美。