Proper way to set mime_module with EA
Migrated to a new server and need to have .html files parsed with php.
In the past I've done this by editing the .htaccess file directly to add the .html and .htm extensions to the mime_module for the correct version of php (we implement multi_php).
However, twice now, something (EasyApache?) has overwritten my modifications with some automated process. It happened at 1:43 am this morning and neither myself or anyone else was logged in to the server. This is a pretty big deal since it breaks the websites and exposes php code as plain text (massive security risk).
So, is there a setting in EasyApache where I can add the mime type? Or somewhere else in Cpanel I can hard code it for each account (or all accounts really would be fine)?
Sorry if I'm missing something obvious but this really caught me off guard.
-
Ok, I found the Apache Handlers setup on the user side of cpanel. I can go ahead and use that. But my question now is, am I going to have to go back into every single account and update those handlers manually if we upgrade the php version for the account? Or does it do that automatically? Is there a better way to be doing this? 0 -
@kwdamp - were you trying to make edits to this block? # 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 # php -- END cPanel-generated handler, do not edit
If so, there's a reason it has the "do not edit" warning in the comments - that section is controlled by the cPanel MultiPHP system and will get overwritten. The cPanel >> Apache Handlers is the correct place to make that adjustment, and that will work with future updates. If you do see odd behavior with that, please let me know.0 -
@kwdamp - were you trying to make edits to this block?
# 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 # php -- END cPanel-generated handler, do not edit
If so, there's a reason it has the "do not edit" warning in the comments - that section is controlled by the cPanel MultiPHP system and will get overwritten. The cPanel >> Apache Handlers is the correct place to make that adjustment, and that will work with future updates. If you do see odd behavior with that, please let me know.
Revisiting this issue as we're once again setting up a new server with around 50 cpanel accounts we control. If I want all .html and .htm files to be parsed for PHP, across all accounts, where can I make that change? Basically, is there a way to globally edit the mime types or globally set an apache handler for each version of PHP?0
Please sign in to leave a comment.
Comments
3 comments