LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-26-2016, 02:30 AM   #1
ario
Member
 
Registered: Nov 2010
Posts: 65

Rep: Reputation: 2
Debian Apache2 PHP interpreted as Plain Text


Debian 8.5.0, Apache2, PHP 5 and PHP files interpreted as Plain Text
Famous problem. I know. But this time I have checked everything and it still doesn't work. I have these packages installed:
Code:
libapache2-mod-php5				install
php5						install
php5-cli					install
php5-common					install
php5-curl					install
php5-gd						install
php5-json					install
php5-mcrypt					install
php5-readline					install
put files in public_html in user directory. Have userdir enabled and working.
This is .htaccess
Code:
AddType application/x-httpd-php .php
This is index.php
Code:
<?php
	phpinfo();
/etc/apache2/mods-enabled/php5.conf:
Code:
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
    SetHandler application/x-httpd-php-source
    # Deny access to raw php sources by default
    # To re-enable it's recommended to enable access to the files
    # only in specific virtual host or directory
    Require all denied
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(p[345]?|t|tml|ps)$">
    Require all denied
</FilesMatch>

# Running PHP scripts in user directories is disabled by default
# 
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
        php_admin_flag engine Off
    </Directory>
</IfModule>
Please help.
Thanks in advance.
 
Old 08-26-2016, 03:47 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
# Running PHP scripts in user directories is disabled by default
#
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_flag engine Off
</Directory>
</IfModule>
Do as you told to do and see if it works:
Code:
# Running PHP scripts in user directories is disabled by default
# 
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
#<IfModule mod_userdir.c>
#    <Directory /home/*/public_html>
#        php_admin_flag engine Off
#    </Directory>
#</IfModule>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
The best way to convert from text/x-c++ iso-8859-1 to text/plain utf8. rm_-rf_windows Linux - General 1 10-03-2012 04:08 AM
PHP script not being interpreted properly ShaqDiesel Programming 5 08-09-2011 06:48 PM
MySQL PHP Apache2 on Debian Stormrage Debian 2 07-16-2006 03:02 PM
whats up with apache2 and php on debian? scuzzo84 Debian 2 01-16-2006 11:30 AM
Php is not getting interpreted? swatward Programming 1 07-31-2005 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration