{"id":67,"date":"2014-11-15T19:22:44","date_gmt":"2014-11-15T19:22:44","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=67"},"modified":"2014-11-15T19:22:44","modified_gmt":"2014-11-15T19:22:44","slug":"throw-scripts-as-text-instead-of-executing-it","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/throw-scripts-as-text-instead-of-executing-it\/","title":{"rendered":"Throw scripts as text instead of executing it"},"content":{"rendered":"<p>To throw PHP or other scripts as text instead of executing it, add the below code to .htacess file.<\/p>\n<pre class='wp-code-highlight prettyprint'>AddType text\/plain .cgi .php .php3 .php4 .php5 .phtml .pl .py .pyc .pyo .sh .html .shtml .jsp<\/pre>\n<p>This method can be used to execute .html files as .php (or for executing any other type of file as some other type).<\/p>\n<p>This requires mod_mime module of Apache to be installed and enabled. <\/p>\n<p><em style=\"font-size:14px\">There might be problem if su_php is enabled. In case the above doesn&#8217;t work for PHP scripts when suPHP is enabled then try adding the following to Apache Directives (main is the highlighted code).<\/em><\/p>\n<pre class='wp-code-highlight prettyprint'>\r\n&lt;Directory \/var\/www\/domain.com\/files\/images\/&gt;\r\n        <span style=\"background-color: #FDFF4F\">suPHP_Engine off<\/span>\r\n &lt;\/Directory&gt;\r\n<\/pre>\n<p><em style=\"font-size:14px\">It is not a good idea to disable suPHP for the whole site, instead disable only for the required directory<\/em>.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>To throw PHP or other scripts as text instead of executing it, add the below code to .htacess file. AddType text\/plain .cgi .php .php3 .php4 .php5 .phtml .pl .py .pyc .pyo .sh .html .shtml .jsp This method can be used to execute .html files as .php (or for executing any other type of file as&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/throw-scripts-as-text-instead-of-executing-it\/\">Continue reading <span class=\"screen-reader-text\">Throw scripts as text instead of executing it<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":4,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/67\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}