SOLVED Code automatically added to .htaccess?

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hello everyone here
I need your help, all my site the .htaccess file in public_html/ will automatically add the code below:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

And then the .php files can only download. After I cleared the code, the website is ruing.
In this months the same issue happened 3 times, could you please let me know, is it possible someone else controlling the server, and how can I stop it.

Thnaks
June
 

Giannis

Well-Known Member
PartnerNOC
Jun 22, 2005
67
0
156
Actually that is the code for the php version that website will use.
You can swich between versions and select the appropriate version for your website.
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hi Giannis

Thanks for your reply, is it possible we stop the automatically add the code in .htaccess,
because I don't know when it will automatically added, sometimes when I find the site are not working..but the site has been stopped for a long time.

Thanks
June
 

Luana Premoli

Well-Known Member
Oct 3, 2016
68
7
8
São Paulo/Brazil
cPanel Access Level
Root Administrator
Hi,

We always set the PHP version directly through .htaccess and it always worked correctly. Now it is also changing automatically.


I noticed that the cPanel update log (Aug 22 01:22 /var/cpanel/updatelogs/last) has an approximate file change time (Aug 22 01:25):

Code:
[[email protected] /home/sinttelg/public_html]# ll .htaccess*
-rw-r--r-- 1 sinttelg sinttelg 4236 Aug 22 09:50 .htaccess
-rw-r--r-- 1 sinttelg sinttelg 4214 Aug 14 01:22 .htaccess.phphandler.1565787528
-rw-r--r-- 1 sinttelg sinttelg 4219 Aug 19 22:18 .htaccess.phphandler.1566305380
-rw-r--r-- 1 sinttelg sinttelg 4219 Aug 22 01:25 .htaccess.phphandler.1566478247
[[email protected] /home/sinttelg/public_html]#




[[email protected] /home/sinttelg/public_html]# ll /var/cpanel/updatelogs/last
lrwxrwxrwx 1 root root 44 Aug 22 01:22 /var/cpanel/updatelogs/last -> /var/cpanel/updatelogs/update.1566447721.log
[[email protected] /home/sinttelg/public_html]#
[[email protected] /home/sinttelg/public_html]#

Wanted to know why this happened?


Code:
[[email protected] ~]# grep '' /etc/redhat-release /usr/local/cpanel/version
/etc/redhat-release:CentOS release 6.10 (Final)
/usr/local/cpanel/version:11.78.0.36
[[email protected] ~]#
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
Hello everyone here
I need your help, all my site the .htaccess file in public_html/ will automatically add the code below:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

And then the .php files can only download. After I cleared the code, the website is ruing.
In this months the same issue happened 3 times, could you please let me know, is it possible someone else controlling the server, and how can I stop it.

Thnaks
June
As of v78 of cPanel/WHM we automatically update the .htaccess with the php version as selected in the MultiPHP manager. If the site is downloading instead of displaying there is most likely an incorrectly added AddHandler added - what is the current PHP version that you're trying to use and what else is listed in the .htaccess?
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
As of v78 of cPanel/WHM we automatically update the .htaccess with the php version as selected in the MultiPHP manager. If the site is downloading instead of displaying there is most likely an incorrectly added AddHandler added - what is the current PHP version that you're trying to use and what else is listed in the .htaccess?
Hello Sir

All my sites in the server using the PHP 5.6.40 and the cPanel add the code at end of the .htaccess blow:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
when this added all the site can only downloading the PHP files instead to displaying that as you say
Thanks for your help
Jun
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hi,

We always set the PHP version directly through .htaccess and it always worked correctly. Now it is also changing automatically.


I noticed that the cPanel update log (Aug 22 01:22 /var/cpanel/updatelogs/last) has an approximate file change time (Aug 22 01:25):

Code:
[[email protected] /home/sinttelg/public_html]# ll .htaccess*
-rw-r--r-- 1 sinttelg sinttelg 4236 Aug 22 09:50 .htaccess
-rw-r--r-- 1 sinttelg sinttelg 4214 Aug 14 01:22 .htaccess.phphandler.1565787528
-rw-r--r-- 1 sinttelg sinttelg 4219 Aug 19 22:18 .htaccess.phphandler.1566305380
-rw-r--r-- 1 sinttelg sinttelg 4219 Aug 22 01:25 .htaccess.phphandler.1566478247
[[email protected] /home/sinttelg/public_html]#




[[email protected] /home/sinttelg/public_html]# ll /var/cpanel/updatelogs/last
lrwxrwxrwx 1 root root 44 Aug 22 01:22 /var/cpanel/updatelogs/last -> /var/cpanel/updatelogs/update.1566447721.log
[[email protected] /home/sinttelg/public_html]#
[[email protected] /home/sinttelg/public_html]#

Wanted to know why this happened?


Code:
[[email protected] ~]# grep '' /etc/redhat-release /usr/local/cpanel/version
/etc/redhat-release:CentOS release 6.10 (Final)
/usr/local/cpanel/version:11.78.0.36
[[email protected] ~]#
Hello
Its also the problem and lets try to fix it,
Jun
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
As I mentioned in my previous response, this is by design which is conflicting with another entry you've manually added. Can you show the contents of your .htaccess?
Hello Sir
I want to attached the .htaccess files to you, but here show me: The uploaded file does not have an allowed extension. so I change it to .txt format
Thanks again
Jun
 

Attachments

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
Hello,


Are you running php-fpm? Or more to the point, why do you have these entries in the .htaccess?


Code:
php_value default_charset "utf-8"
php_flag display_errors off
php_flag error_reporting 7
php_flag register_globals off
php_flag magic_quotes_gpc off

php_value upload_max_filesize 1000M
php_value post_max_size 1000M
php_value max_execution_time 86400
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hello,


Are you running php-fpm? Or more to the point, why do you have these entries in the .htaccess?


Code:
php_value default_charset "utf-8"
php_flag display_errors off
php_flag error_reporting 7
php_flag register_globals off
php_flag magic_quotes_gpc off

php_value upload_max_filesize 1000M
php_value post_max_size 1000M
php_value max_execution_time 86400
Yes Sir. the server run the php-fpm, and all the entries in the .htaccess is from the script Supplier.

And yesterday I got the email from Cpanel that say.

Notification: The service “httpd” appears to be down.

Service Check Method: The system failed to connect to this service’s TCP/IP port.

Reason: Service check failed to complete
Unable to connect to port 80 on 127.0.0.1: Connection refused: Died

Startup Log : AH00526: Syntax error on line 6264 of /etc/apache2/conf/httpd.conf:
SSLCertificateFile: file '/var/cpanel/ssl/cpanel/mycpanel.pem' does not exist or is empty

All my sites was down and I restart the server then they are run again, this server with me about 3 years, this issue is the first time happen. maybe I have to moving to a new server.

Thanks Sir, thanks everyone here
Jun
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
You most likely don't need to move to a new server but at this point, I'd suggest you open a ticket, you can find instructions on how to do this in the link in my signature. Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hello Sir

Sorry for the dealy,the cPanel & WHM license before I was buy from soyoustart and the price is $20, but I see if the license not directly from your company,maybe can't get the support, so I want to buy from your company directly, I using Dedicated server, so I should to buy the Metal license-Premier $45 month, or Admin license-$20 per month

Thanks
Jun
 
Last edited:

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hello Sir
in WHM at MultiPHP Manager,the System PHP Version is PHP 5.6 (ea-php56) and the PHP Handler is dso,
here also have PHP5.5, PHP7.0 and PHP7.1 but the PHP Handler I can only choose: cgi and none, there no DSO that I can usie, but my website script MUST run with DSO

So how can I find the DSO Handler for PHP7.1
-------------------------------------
For code automatically added to .htaccess

System PHP Version is PHP 5.6 (ea-php56) with DSO Handler
PHP-FPM on all the domains

IMPORTANT!!!
when I set the PHP-FPM on, the .htaccess immediately automatically changed.

Can someone help thansk advance
Jun
 

quietFinn

Well-Known Member
Feb 4, 2006
1,379
172
193
Finland
cPanel Access Level
Root Administrator
  • Like
Reactions: cPanelLauren

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
cPanel documentation here:
says:
"You can only use DSO as the handler for one version of PHP on your system. "
Thanks QuietFinn

I just find it, and if I want to using PHP7.1 with DSO handler as the System PHP Version , must cancel the PHP 5.6 DSO first, than set the PHP7.1 to DSO, is it correct,

Thanks again and have nice day
Jun
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
You most likely don't need to move to a new server but at this point, I'd suggest you open a ticket, you can find instructions on how to do this in the link in my signature. Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!
Hello Sir
I just open a ticket for this issue and the Ticket ID is 13309329, if you have the time pleas help.
Thanks
Jun
 

globaljt

Member
Dec 15, 2016
19
2
3
germany
cPanel Access Level
Website Owner
Hello,

Thanks for that, I checked in on the ticket and added a note to it going over what we discussed in this thread. I'll update here when the issue is resolved.
Hello Sir
The issue was fixed by your team, they help me to update the cPanel and PHP version, using the PHP-FPM and at "Edit PHP-FPM" set not disable the"Shell_Exec" and "Exec.
so now the website is running well and also using the .htaccess file that cpanel automatically add the code, IMPORTANT is the site not down like before now,

Thanks for all
Jun
 
  • Like
Reactions: cPanelLauren