how to control ErrorDocument from .htaccess when we use PHP cgi-fcgi ?

000

Well-Known Member
Jun 3, 2008
533
29
78
when we use PHP-FPM the .htaccess is loaded correctly, but with PHP cgi-fcgi only *.shtml is loaded.

Yes, we can EDIT the files *.shtml but we need MANAGE ErrorDocument from OUR .htaccess


is possible enable the load of .htaccess when we use PHP cgi-fcgi ?, how?


thanks
 

quietFinn

Well-Known Member
Feb 4, 2006
1,697
352
438
Finland
cPanel Access Level
Root Administrator
I'm not sure if I understand what you mean by "load of .htaccess". :rolleyes:
Apache reads .htaccess and in .htaccess you can use Apache directives (like ErrorDocument).
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator

quietFinn

Well-Known Member
Feb 4, 2006
1,697
352
438
Finland
cPanel Access Level
Root Administrator
What do you mean by "send .shtml to client"?
 

000

Well-Known Member
Jun 3, 2008
533
29
78
I'm not sure if I understand what you mean by "load of .htaccess". :rolleyes:
Apache reads .htaccess and in .htaccess you can use Apache directives (like ErrorDocument).
thanks,
this is my .htaccess:
Code:
ErrorDocument 400 /mymanager.400.php
ErrorDocument 401 /mymanager.401.php
ErrorDocument 403 /mymanager.403.php
ErrorDocument 404 /mymanager.404.php
ErrorDocument 413 /mymanager.413.php
ErrorDocument 500 /mymanager.500.php
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81†package as the default “PHP†programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
but FOREVER any error load .shtml from cPanel
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator
thanks,
this is my .htaccess:
Code:
ErrorDocument 400 /mymanager.400.php
ErrorDocument 401 /mymanager.401.php
ErrorDocument 403 /mymanager.403.php
ErrorDocument 404 /mymanager.404.php
ErrorDocument 413 /mymanager.413.php
ErrorDocument 500 /mymanager.500.php
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81†package as the default “PHP†programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
but FOREVER any error load .shtml from cPanel
@quietFinn I thhink what he is trying to say is the erro documents that we have in cPanel are .shtml but they want to use there own error documents like below

ErrorDocument 401 /mymanager.401.php
ErrorDocument 403 /mymanager.403.php
ErrorDocument 404 /mymanager.404.php
ErrorDocument 413 /mymanager.413.php
ErrorDocument 500 /mymanager.500.php

so when he changes to cgi-fcgi

when there is an error on the site the error documents are not his above they are the ones that cPanel supplies

am I correct @000
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator

there is a tweak setting for error documents not to be cPanel for accounts and you can disable it in WHM

maybe this thread will help you ?
 

000

Well-Known Member
Jun 3, 2008
533
29
78
... when there is an error on the site the error documents are not his above they are the ones that cPanel supplies
yes!, is 100% true. web NOT LOAD OUR "manager.CODE.php", ignore our .htaccess and load .shtml from cPanel
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator
yes!, is 100% true. web NOT LOAD OUR "manager.CODE.php", ignore our .htaccess and load .shtml from cPanel
I have not tried it, but this is where that forum post says you can disable cPanel document error ?

Tweak Settings -> System, " Copy default error documents to docroot for new accounts, addon domains, and subdomains "
 

000

Well-Known Member
Jun 3, 2008
533
29
78
I have not tried it, but this is where that forum post says you can disable cPanel document error ?

Tweak Settings -> System, " Copy default error documents to docroot for new accounts, addon domains, and subdomains "
thanks, we search how DISABLE default load of .shtml files, but we not find how disable for $user55cPanel
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator
thanks, we search how DISABLE default load of .shtml files, but we not find how disable for $user55cPanel
did you disable that feature in tweak settings ?
Code:
Copy default error documents to docroot for new accounts, addon domains, and subdomains [?]
When enabled, the system copies the default error documents to the document root directory when you create new accounts, addon domains, and subdomains. By copying the default error documents to the document root, this ensures that the global ErrorDocument configuration has the files its needs to prevent generating additional errors.
and did you remove the error documents in the cpanel user home directory ?
just wondering.
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator
thanks, we search how DISABLE default load of .shtml files, but we not find how disable for $user55cPanel
Also did you restart apache server after make changes ?
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator
when we use PHP-FPM the .htaccess is loaded correctly, but with PHP cgi-fcgi only *.shtml is loaded.
I see you use php81 did you try php8 or php7.4 to see if it still use .shtml when using PHP cgi-fcgi ?

just wondering if it has to do with php8.1
 

Spirogg

Well-Known Member
Feb 21, 2018
700
161
43
chicago
cPanel Access Level
Root Administrator
yes, we try with 7.4
and ALL is identic
just being curious can you change the names of the files to test

ErrorDocument 401 /mymanager.401.php
ErrorDocument 403 /mymanager.403.php
ErrorDocument 404 /mymanager.404.php
ErrorDocument 413 /mymanager.413.php
ErrorDocument 500 /mymanager.500.php


ErrorDocument 401 /mymanager401.php
ErrorDocument 403 /mymanager403.php
ErrorDocument 404 /mymanager404.php
ErrorDocument 413 /mymanager413.php
ErrorDocument 500 /mymanager500.php

not sure but test one mymanager401.php

see if the extra "." confuse cgi-fcgi ??
 

quietFinn

Well-Known Member
Feb 4, 2006
1,697
352
438
Finland
cPanel Access Level
Root Administrator
I tested this and it loads the errordocument I have in .htaccess file.
PHP handler = fcgi, PHP version 7.4

ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 413 /413.php
ErrorDocument 500 /500.php

Well at least 404 works...