duanchazhou6779 2014-12-27 20:54
浏览 148
已采纳

Apache2升级后不执行PHP 5.6脚本

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.

  • 写回答

1条回答 默认 最新

  • dspym82000 2014-12-28 14:14
    关注

    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.)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题
  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源