Jump to content

Php Scripts Embedded In Html File Not Working On Tommy


pab49162

Recommended Posts

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 - Paul

and did the following

added

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 Error

The 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 this

https://my.getstarted.com.au/knowledgebase/56/500-Error-File-is-writeable-by-group.html

500 Error: File is writeable by group


On 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 :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...