簡體   English   中英

LAMP服務器安裝失敗。當復制到var / www / html /中時,本地主機未列出諸如codeigniter之類的目錄

[英]LAMP server installaion failed.. localhost does not list directories like codeigniter when copied in var/www/html/

我已經檢查了apache,mysql和php是否使用aptitude安裝在ubuntu 14.04中,並且都已安裝。

但是當(文件另存為info.php)時

<?php
phpinfo();
?>

上面的文件保存在var / www / html目錄中,當嘗試使用url localhost / info.php從瀏覽器訪問文件時,它顯示為

在此處輸入圖片說明

有什么問題 有什么幫助嗎?

你需要這個:

apt-get install libapache2-mod-php5
sudo a2enmod php5
sudo service apache2 restart

或者(如果您已經安裝了那些)

AddType application/x-httpd-php .php

在Apache的配置文件中

除了Alex Tartan的答案,您還需要:

<FilesMatch "\\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch>

在您的php5.conf

這樣可以代替提供index.html文件等。它將提供index.php文件。

參見: https : //serverfault.com/questions/286882/apache-is-not-interpreting-php-files

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM