PHP Script is not working in .html file
I have placed my sample code below here
File Name: index1.html
Output Expected PHP Output HTML Output But it showing only HTML output. I have tried with various .htaccess codes from different source. None of them is worked for me. I have pasted below the .htaccess codes below for reference. Help me out any to resolve this issue.
2nd Set of Codes Not Working.
PHP inside HTML
HTML Output
Output Expected PHP Output HTML Output But it showing only HTML output. I have tried with various .htaccess codes from different source. None of them is worked for me. I have pasted below the .htaccess codes below for reference. Help me out any to resolve this issue.
.htaccess code
AddHandler application/x-httpd-php56 .shtml .html .htm
AddHandler server-parsed .shtml .shtm .htm .html
AddHandler x-httpd-php .html .htm
AddHandler application/x-httpd-php5 .html .htm
AddHandler application/x-httpd-php .htm
AddHandler application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
2nd Set of Codes Not Working.
AddHandler x-httpd-php5 .html
AddHandler x-httpd-php5 .htm
AddHandler application/x-httpd-php .htm
AddHandler application/x-httpd-php .html
If the MIME types in cPanel. while browser the web page it downloads the page instead of viewing the content.
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
Return Internal Server Error
Options +ExecCGI
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html
AddHandler x-httpd-php5-cgi .html
AddHandler fcgid-script .html
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html
">
AllowOverride All
-
What are you using handler codes for? If you use the default php version, you should not use handler codes in htaccess in inherit mode. If you choose php version, cpanel automatically adds handler codes to htaccess file. The different handler codes you add will create conflicts. It can also help with apache error_log records. 0 -
Thank you Vacancy, for replying on this. I'm using PHP Version 5.6 and my server is powered by CloudLinux also. But it is not showing any error logs for me. I have tried with this set of codes in the below code it is working fine for me thanks a lot friend. AddHandler application/x-httpd-ea-php56 .htm .html .shtml AddType application/x-httpd-php5 .php 0 -
I have tried with this set of codes in the below code it is working fine for me thanks a lot friend. AddHandler application/x-httpd-ea-php56 .htm .html .shtml AddType application/x-httpd-php5 .php
Hello, I'm happy to see you were able to address the issue. Thank you for updating us with the outcome.0 -
FYI, the 2-line solution that Vasanthjan posted didn't work for me, but it pointed me in the right direction. This did work: AddType application/x-httpd-ea-php56 .html 0
Please sign in to leave a comment.
Comments
4 comments