There are several reasons that your PHP files may not be working properly. Here are the top ones and how to fix them.
PHP is a tool that lets you create dynamic web pages. PHP-enabled web pages are treated just like regular HTML pages, and you can create and edit them the same way you normally create regular HTML pages. PHP is also the second most common language for website pages. PHP because of being dynamic uses more load on the server and is more vulnerable to hacking. This makes it important to make sure any PHP scripts are upgraded right away as needed.
1. Wrong PHP version
The main reason a PHP file does not work is that you're not on a compatible PHP version. In your cPanel, search for MultiPHP. There, you can change versions to see if any work with your website. The newer the PHP version, the better the security and performance. Some apps require older PHP versions to work, or the app just needs to be updated. Once you change a PHP version, you'll have to wait about 2 minutes for it to start working.
2. Misconfigured .htaccess file
This is a little harder to troubleshoot. You'll need to remove everything from all .htaccess files in folders before your content. Normally, there's only one .htaccess file you have to change. This is normally located in the main public_html folder. Once everything is removed and your site is working, you can add the code back to the .htaccess file piece by piece to see what part is causing the error. In some cases, you'll have to add some code back for it to work as well.
3. A bad app, theme, or plugin
Sometimes the app you're using just has bad code or is broken. In this case, you'll need to get a new version and upload all the files over the existing ones. Just don't forget to save your database and configuration settings. For bad plugins, simply delete the plugin in your file manager and try to load the site again. For themes, you'll need to use a default theme, with the folder it's in renamed to the same name as the theme you're using. Then in your file manager, remove the theme you're using and upload the default theme that's renamed to match it.