Master:
# 1    PHP turn off error display in .htaccess                  
Tim
Online no
State
Grouping Member
Class class3
Score 78
Wealth 84
Posts 51
Login 23:52:42
I write the following in a .htaccess
php_flag display_errors off

Then got error in the web site:
Internal server error
Hits: 2521, Date: 2010-04-20 01:55:09
[Agree] ( 8 ) [Against] ( 9 )

# 2    The reason could be the apache server is configured not allow to be overwriten                  
Tim
Online no
State
Grouping Member
Class class3
Score 78
Wealth 84
Posts 51
Login 23:52:42
So the php_flag is regarded forbidden syntax.
Hits: 2520, Date: 2010-04-20 01:58:24
[Agree] ( 7 ) [Against] ( 10 )

# 3    php_value or php_flag does not work if the server is CGI mode                  
Dude
Online no
State
Grouping Member
Class class4
Score 161
Wealth 125.5
Posts 116
Login 00:20:49
php_value or php_flag only work in apache mode.
Hits: 2518, Date: 2010-04-20 02:04:22
[Agree] ( 8 ) [Against] ( 9 )

# 4    In shared hosting and CGI mode, the best solution is using ini_set()                  
exp
Online no
State
Grouping Member
Class class4
Score 348
Wealth 219
Posts 269
Login 11:49:09
You may include the ini_set() in all php pages that need the setting.

ini_set() example for display_error setting
ini_set(display_errors,"Off");
Hits: 2516, Date: 2010-04-20 02:21:06
[Agree] ( 8 ) [Against] ( 9 )

# 5    ini_set another option                  
exp
Online no
State
Grouping Member
Class class4
Score 348
Wealth 219
Posts 269
Login 11:49:09
ini_set(display_errors,0);

It is 0 not "Off"
Hits: 2514, Date: 2010-04-20 02:53:38
[Agree] ( 7 ) [Against] ( 9 )

# 6    if ini_set does not work                  
luke1
Online no
State 453
Grouping Super Admin
Class class4
Score 250
Wealth 62
Posts 230
Login 07:37:57
You can try:
error_reporting (0);

Put this line in the top of php page.
Hits: 2512, Date: 2010-04-20 10:41:31
[Agree] ( 8 ) [Against] ( 9 )

# 7    it works, thanks                  
hans
Online no
State
Grouping Member
Class class4
Score 221
Wealth 155.5
Posts 156
Login 21:17:46
You can try:
error_reporting (0);

Put this line in the top of php page. Posted by: luke1

Hits: 2480, Date: 2010-05-10 01:04:50
[Agree] ( 9 ) [Against] ( 17 )

1 - 7 [ 7]

Reply: PHP turn off error display in .htaccess

*First line:


More content:


Tags:



Hint: You cannot post here before loginLogin | Register

nothing