PHP not working, prints source code

3 posts / 0 new
Last post
#1 Tue, 09/26/2017 - 13:55
zzmaster

PHP not working, prints source code

Hello,

I just installed Virtualmin.

Operating system CentOS Linux 6.9 Webmin version 1.852 Usermin version 1.720 Virtualmin version 6.00

PHP versions 5.3.3, 5.6.25, 7.0.10 Re-Check Configuration works fine.

PHP Mode is Apache mod_php (run as Apache's user) default PHP version is 5.6.25

First this mode option was available, then, after adding virtual host - disappeared, then I installed

yum --enablerepo=centosplus install mod_php

it appeared back.

Searched for SetHandler

# grep -r -i --include \*.conf SetHandler /etc
/etc/httpd/conf/httpd.conf:#    SetHandler server-status
/etc/httpd/conf/httpd.conf:#    SetHandler server-info

/index.html - ok but /i.php - outputs source code.

My httpd.conf is here https://justpaste.it/1bq1y

Restarting apache not helped.

Please help.

Wed, 09/27/2017 - 10:11
zzmaster

The problem was that my php.ini configured not to process short php tags like <? I just wander if there's any slight reason to configure that way by default in the year 2017?!

Wed, 09/27/2017 - 20:36
Joe
Joe's picture

As I understand it, short tags are not recommended in the general case, and should be enabled specifically in situations that need it. The <?= short tag (for echo) is enabled in PHP by default from version 5.4 onward. I believe most applications use the <?php opening tag.

--

Check out the forum guidelines!

Topic locked