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 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]…
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.)
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.