.htaccess - deleted or renamed, but after a while is auto recreated, and the web app Not working

This web app - I have created -
https://translate-4-polyglots.paphos.city/
works only if the:
.htaccess -
deleted or renamed, but after a while is auto recreated, and the web app Not working, well?
Note: yyy.paphos.city, exist many versions of PHP in these domain/subdomains

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

I would ask your host. It’s their system that’s recreating it.

1 Like

What is doing the
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml

?

Note: yyy.paphos.city, exist many versions of PHP in these domain/subdomains

It’s telling apache to handle files with those extension with PHP.

Is your website written in PHP? If so, which version? Maybe you can configure the right one in cPanel.

Can we get a little better description of “the web app Not working”? (Are we sure it’s the PHP handler causing the problem?)

1 Like

I have a php file (for doing a fetch from Web Translate API) and index.html do AJAX call to this php file… to get the translation…

If this .htaccess exist i get error 500 for the php file in console of Chrome browser, if remove or rename this .htaccess the web app working OK…
Working OK - WITHOUT ANY OTHER CHANGE ONLY RENAME THE .htaccess, even without web page refreshing, just rename

If the web app Not working, then I go and delete the .htaccess, is the resulting working,… No needed to modify any client[js/jquery] or server code[php]…

How about you stop ranting and answer some of the questions we asked?

I assume the true problem is that his code doesnt work in PHP7, but works in whatever version the webhost defaults to without the htaccess handler in place (probably a PHP5 flavor?).

That said, the user wants to handle this with the hammer instead of the chisel, so onward, nail-seeker. Onward. As @rpkamp suggested, check your cPanel to see if you can change the version of PHP being used, or as @Gandalf suggested, talk to your host to see what can be done.

(And when they tell you to fix your script, the PHP category is riiiight over there. Just sayin.)

1 Like

Thanks for your reply and advise…
So, you mean if the .htaccess - see initial post above - is present as shown above, then the web app php part, must be php 7/7.4 compatible, otherwise if Not compatible, then will be getting 500 error … this you mean…?

Yes that is correct. So if you need a different php version you can check if you can change that in cPanel. If not, there is nothing left but contact your host.

Usually cPanel will let you set different PHP versions to different domains on that account.
Here there is only one domain, but you select the checkbox for the domain(s) you want to change, then choose a version from the drop-down and Apply.

1 Like

Thanks for your reply,
If post php code here, can you tell, How-To convert to php7.4… hence as you say is in another php version …?

I would recommend against that as php 7.4 is old and no longer supported.

Have you tried changing the PHP version for your site in cPanel?

1 Like

Do you mean change version to PHP 8.x or to lower of 7.4… PHP…?

Change to the version you need. I don’t know which one that is. You never told us.

Just try several until you find one that works?

1 Like

I mean, if you’re gonna tell the guy you recommend against php 7.4 because end of support, you could at least say your suggestion is 8.x :stuck_out_tongue:

Go up, not down, OP. Get the script working with the latest version of PHP you can, and it’ll be in support for the longest time possible.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.