Does .htaccess get oiverwritten on upgrades?

Mick Dawlings Posted in Technical Support 11 months ago

Does .htaccess get oiverwritten on upgrades?

Replies
us Mick Dawlings Replied 11 months ago

I checked and found this;

When using PHP-FPM, .htaccess files do not directly affect PHP settings because PHP runs separately from Apache. This means that the PHP configuration cannot be overridden by .htaccess in a PHP-FPM setup.

This means I'll have to test again then because php.ini should be being used primarily so what ever happened might have been a fluke.

us Mick Dawlings Replied 11 months ago

No cpanel.
That's interesting then.
I did edit the php.ini file directly but when I tested, the .htaccess seemed to be overriding the php.ini settings.
I'll have to test again I guess.

Indonesian Arsalan Shah Replied 11 months ago

As far as i know php-fpm doesn't take php rules from .htaccess, if you are using a default installation without panel like cpanel then you need to edit php.ini manually of server.

us Mick Dawlings Replied 11 months ago

That's not an example, it's a rude comment that belittles the other person, and is not related server configurations.
No need for that kind of thing.

Anyhow...

likewise you can control what type of server api you use phpfpm, or mod apache. If you want to make part
of .htaccess work then you need to use mod apache instead of fpm. Your server seems using phpfpm and
still not sure if in your phpfpm settings if it is also taking ossn local .user.ini file or not.

Now that you're talking about web servers... Yes in this case, the server is using php-fpm. In fact, it was built from a template that most of the other web servers use so I never thought of checking that but I will now that you mention it.

Thank you.

Indonesian Arsalan Shah Replied 11 months ago

Mick, i provided the example only because not everyone is programmer here so giving real world example helps them to understand the point.

us Mick Dawlings Replied 11 months ago

Mick, I would like to ask simple question do you control if you can put Deiseal in your petrol car?
What's the point of being rude with members and worse, potential or actual customers?

Just give your input without insulting people, that would be great.

Indonesian Arsalan Shah Replied 11 months ago

Mick, I would like to ask simple question do you control if you can put Deiseal in your petrol car? likewise you can control what type of server api you use phpfpm, or mod apache. If you want to make part of .htaccess work then you need to use mod apache instead of fpm. Your server seems using phpfpm and still not sure if in your phpfpm settings if it is also taking ossn local .user.ini file or not.

https://www.php.net/manual/en/ini.core.php#ini.user-ini.filename

us Mick Dawlings Replied 11 months ago

I can't really control it using the server since we would want part of the .htaccess to work and part of it not to.
Meaning, the override php settings are the only settings we would not want to be overriding the php.ini.

Indonesian Arsalan Shah Replied 11 months ago

I understand it, the .htaccess settings will override the php.ini settings\

This controlled by how server is configured. So you need to test out if .htaccess php settings are working or user.ini / php.ini

us Mick Dawlings Replied 11 months ago

As mentioned, I simply commented out the php.ini settings that are in the .htaccess.
As I understand it, the .htaccess settings will override the php.ini settings so how do I customize my php settings without having them changed on me every time I upgrade?