(apache server ) phtml writes all the php code as text in the browser
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(apache server ) phtml writes all the php code as text in the browser
I have gotten this job of managing an old website, but the problem is that all files end with *.phtml and not just *.php. When I try to view a php3 file on my localhost it just writes all the php code as text in the browser. (I'm running Apache/2.4.6 with php PHP 5.4.16 and centos 7.2 core installed on server .
i do the following steps but can't succeed
DirectoryIndex index.php index.php3 index.html
AddType application/x-httpd-php .php .phtml
.
kindly help to solve this problem
Take a look at the php scripts. What is the openening tag for php code in there? Could be
<?php
or
<?
maybe
<?php3
If it is the 2nd you have to tell the server to use the short version. In php.ini set
short_open_tag=On
and restart the server
If it is the last you at best change the scripts I guess. Anyway you should consider sorting these scripts out as PHP3 is really very very old and may not run on the server with PHP5.4. Very very likely it will not work in higher versions like 5.6 or 7.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.