Display the source code instead of pages displayed

epiz_30751867 (e.g. epiz_30751867) or Website URL

(please specify the website or account you are asking about)

Display the source code

(please share the FULL error message you see)

when I browse my site with the browser the page can’t displayed but it can display the php source code

(other information and details relevant to your question)

Since you did not provide enough info, no one can help you


Please referee this image file

Add this to your .htaccess:

AddType text/html .php
2 Likes


I can add it but it can’t work now

Do you see the line that says “DO NOT EDIT THIS FILE”?

Follow the instructions below that and then add

1 Like

Yes this message displayed during saving

Create a new .htaccess in your htdocs folder. Then add this:

3 Likes

Thank you it works

1 Like

By default, all .php files are executed as PHP code. If that doesn’t happen for your site, then most likely you have some .htaccess rules somewhere that change this behavior.

I checked your .htaccess file, and I see this line is present:

AddHandler application/x-httpd-php5 .php .html

If I comment out this line, the the views/index.php line gets executed as PHP (as it should). Without it, the PHP code is sent to the browser instead.

The default settings of the server are good for almost all cases. So I would suggest removing all the AddHandler and AddType rules everywhere, because in my experience they tend to cause more problems than solve them.

4 Likes

In My Side it can’t work without AddHandler in PHP Version 5.6 and lower but in 7.4 it can’t work in both ways. So what shall I do?

It should work without the AddHandler in PHP 5.6 too. And if your website can run on PHP 7.4, you definitely should, because PHP 5.6 is old and insecure. In general, you should always use the latest stable version of PHP if you can.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.