pab49162 Posted February 16, 2017 Posted February 16, 2017 With the demise of the Stevie server, I now have an account on the Tommy server and am trying to get a website back up and running. I am having a problem getting the server to parse PHP scripts embedded within HTML files having an .html extension. On Stevie, I used the following .htaccess directive to set up html files so they were executed like php files: AddHandler application/x-httpd-php5 .html Unfortunately, this directive does not seem to work on Tommy as the embedded PHP script is basically ignored. Any info on what I need to do to resolve this problem would be greatly appreciated. Thanks - Paul
Krydos Posted February 17, 2017 Posted February 17, 2017 On Tommy it depends on which version of php you want to use. For instance if you want to use php 7.1 then use AddType application/x-httpd-ea-php71 .html
pab49162 Posted February 17, 2017 Author Posted February 17, 2017 Thank you for the reply as the information you provided fixed my problem! In case anyone else has the same question, you can find out which version of PHP you are using in the MultiPHP Manager under the Software category on the cPanel home page. In my case, I was inheriting the system default PHP version which is ea-php56. So in the .htaccess file, I added the following directive: AddType application/x-httpd-ea-php56 .html Once I did this and saved the file, the server did processed the embedded PHP script. Thanks again - Paul
isuru Posted February 21, 2017 Posted February 21, 2017 Hi, so I'm yet another noob, so please bare with me.I have read this....Thank you for the reply as the information you provided fixed my problem! In case anyone else has the same question, you can find out which version of PHP you are using in the MultiPHP Manager under the Software category on the cPanel home page. In my case, I was inheriting the system default PHP version which is ea-php56. So in the .htaccess file, I added the following directive: AddType application/x-httpd-ea-php56 .html Once I did this and saved the file, the server did processed the embedded PHP script. Thanks again - Pauland did the followingadded AddType application/x-httpd-ea-php70 .html to my .htaccess since I'm using ea-php70 which made my .htaccess file look like this... RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] AddType application/x-httpd-ea-php70 .html and yet I receive the following error Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator at webmaster@isuru.heliohost.org to inform them of the time this error occurred, and the actions you performed just before this error.More information about this error may be available in the server error log.Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.what am I doing wrong? without the php line AddType application/x-httpd-ea-php70 .html with just the this RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] in my .htaccess file, my index.html file displays perfectly fine from what I can see... so what am I doing wrong trying to get php to render html?Hello again, this is rather embarrassing but then again I did say I'm a "noob" so I have seen thishttps://my.getstarted.com.au/knowledgebase/56/500-Error-File-is-writeable-by-group.html 500 Error: File is writeable by groupOn occasion you may get a 500 page error (a green/blue error page) when trying to run a PHP script in your account. When checking the error og which you can do via the cPanel account log in you may see the following line: [Wed Jan 31 16:34:12 2011] [error] [client 11.111.111.111] SoftException in Application.cpp:256: File "/home/username/public_html/index.php" is writeable by group This is due to the server running SuPHP and the files having higher permissions than allowed, to fix this problem you need to make sure your files are chmod 644 for all PHP based files and 755 for directories in order for them to work with SuPHP.You can easily do this by connecting via FTP with Filezilla and right clicking on the problem folders and files and selecting file permissions. and it WORKS :) Thank you to anyone who had a look at this. Hope this helps anyone who gets in the same JAM
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now