-1

I've upgrade PHP 5.5 to 5.6. After this my Apache don't execute my PHP script.

With Iceweasel (Firefox) i have a blank page and with google chrome it's display the code source.

My code source:

<?php

    echo "test";
?>

I follow this intructions: Upgraded PHP now apache won`t execute php files anymore

I've installed libapache2-mod-php5.

And i've edited this file: /etc/apache2/mods-available/php5.conf and I've commented these lines in this file:

# 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>

Php websites don't work after changin php version

And of course I don't forget to restart Apache2.

My linux distribution is Kali.

7
  • 3
    What does "don't execute" mean? It returns the original source code? Are you using short PHP tags? Commented Dec 27, 2014 at 20:56
  • There's definitely something fishy going on. ;) Commented Dec 27, 2014 at 21:00
  • Please consider to post more information about the issue, with your question and the few information you gave, the answer is not answerable Commented Dec 27, 2014 at 21:50
  • 1
    Did you enable the module? e.g. a2enmod php5? Commented Dec 28, 2014 at 13:31
  • 1
    (Incidentally, Iceweasel and other browsers will show you a blank page because they're interpreting everything from the < of <?php to the > of ?> as an unknown HTML element. You'd get the same behaviour with <wibble ...>, for example. You should always view the page source in your browser, or use a tool like curl or wget, to diagnose this kind of problem.) Commented Dec 28, 2014 at 13:35

1 Answer 1

1

You say you've installed the module and edited the /etc/apache2/mods-available/php5.conf file, but you also need to check that the module is actually enabled.

Its module loader file, php5.load should appear in the /etc/apache2/mods-enabled/ directory if it's enabled (it'll be a symbolic link to the file in mods-available). If it doesn't, you need to enable it with with sudo a2enmod php5 (and restart apache with service apache2 restart.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.