automatic htaccess creation
.htaccess files keep getting created.
All my websites stop working and start downloading php files to users browsers.
I need it to stop.
Please please please can someone tell me how to stop this code getting added to .htaccess?
I don't use htaccess's I use virtualhost conf.d/includes.
[CODE=apacheconf]
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php73" package as the default "PHP" programming language.
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
# php -- END cPanel-generated handler, do not edit
-
As far as I understand it there is no supported method to keep this from being created. It's done automatically by cPanel. What are you adding in the VirtualHost include? 0 -
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): [root@788 /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 [root@788 /home/sinttelg/public_html]#
[root@788 /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 [root@788 /home/sinttelg/public_html]# [root@788 /home/sinttelg/public_html]#
Wanted to know why this happened?[root@788 ~]# grep '' /etc/redhat-release /usr/local/cpanel/version /etc/redhat-release:CentOS release 6.10 (Final) /usr/local/cpanel/version:11.78.0.36 [root@788 ~]#0 -
As of v78 we started auto-updating the .htaccess with the PHP configuration currently set in the Multi-PHP Manager. The text in the .htaccess also clearly indicates that the speciifc portion is auto-generated and should not be modified manually. For example: # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php71" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php71 .php .php7 .phtml # php -- END cPanel-generated handler, do not edit0 -
We've been experiencing this same issue for 6 months. In our case, cpanel changes the package in htaccess from ea-php52 to ea-php71 causing the site to crash (500 server error) We change the handler back to 52 and the website works again. Now, the strange part is we have two identical web sites on the same server, same PHP, save everything except for the domain. The second site is never updated. Any assistance would greatly be appreciated. 0 -
You cannot set the PHP version through the .htaccess, it must be set through the MultiPHP Editor, the .htaccess will be updated to whatever is selected in the cPanel account's MultiPHP Interface. 0 -
any solutions getting same issue on our servers # To remove index.php from URL RewriteEngine On RewriteBase / Options All -Indexes RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] #RewriteCond %{HTTP_HOST} !^us01\. [NC] #RewriteRule .* https://us01.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] #extracted RewriteCond %{REQUEST_URI} ^system.* RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ #RewriteRule ^(.*)$ index.php/$1 [L] RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA] #RewriteRule ^/assets/images/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/logo\.png$ /images.php?file=$1.png [NC,L] # BEGIN cPanel-generated php ini directives, do not edit # Manual editing of this file may result in unexpected behavior. # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor) # For more information, read our documentation (PHP Home - EasyApache 4 - cPanel Documentation) #php_flag asp_tags Off #php_flag display_errors On #php_value max_execution_time 30 #php_value max_input_time 60 #php_value max_input_vars 1000 #php_value memory_limit 128M #php_value post_max_size 8M #php_value session.gc_maxlifetime 1440 #php_value session.save_path "/var/cpanel/php/sessions/ea-php56" #php_value upload_max_filesize 2M #php_flag zlib.output_compression On # END cPanel-generated php ini directives, do not edit # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php56" package as the default "PHP" programming language. #AddHandler application/x-httpd-ea-php56 .php .php5 .phtml 0 -
its updating on daily basis, please suggest any solution to stop this auto update 0 -
@josephlewis12344 - can you get us some more specific details - what specifically do you see updating each day? 0 -
only htaccess shared above updated automatically on all our servers where we are using cPanel product. Whereas our htaccess overwritten on daily basis, 0 -
cPanel uses the .htaccess file to control the PHP version assigned to the account, so it is normal for that to be recreated or adjusted each day if it is edited. 0 -
is there any way to stop it as our edited htacess totally gone from the account. We have tweak all the settings to stop it using online peoples experience but in this way our websites gone offline everyday. 0 -
The only part of the file cPanel will edit is the section at the bottom that looks like this: # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php74" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php74 .php .php7 .phtml # php -- END cPanel-generated handler, do not edit
Everything above that line is not managed by cPanel, so if that is where you are seeing the changes made it is something else editing that file.0 -
is it right if I can disable the /etc/cpupdate.conf manually from daily updates? 0 -
You could, but that isn't something we'd recommend. To be extra sure of what is changing that file, you could use an audit watch to see if that will get you more details on what is making the change. More details on that can be found here: How to investigate unintended file modifications 0
Please sign in to leave a comment.
Comments
14 comments