[英]LAMP server installaion failed.. localhost does not list directories like codeigniter when copied in var/www/html/
i have checked if apache , mysql and php are installed in ubuntu 14.04 using aptitude and all are installed. 我已经检查了apache,mysql和php是否使用aptitude安装在ubuntu 14.04中,并且都已安装。
but when (file is saved as info.php) 但是当(文件另存为info.php)时
<?php
phpinfo();
?>
the above file is saved in var/www/html directory and when trying to access files from broswer using url localhost/info.php it shows like 上面的文件保存在var / www / html目录中,当尝试使用url localhost / info.php从浏览器访问文件时,它显示为
what's the issue? 有什么问题 any help?
有什么帮助吗?
You need this: 你需要这个:
apt-get install libapache2-mod-php5
sudo a2enmod php5
sudo service apache2 restart
Or (if you already have those installed) 或者(如果您已经安装了那些)
AddType application/x-httpd-php .php
in apache's config file 在Apache的配置文件中
In addition to Alex Tartan's answer you will also need: 除了Alex Tartan的答案,您还需要:
<FilesMatch "\\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch>
Within your php5.conf
在您的
php5.conf
This is so instead of serving up an index.html file etc. it will serve up an index.php file. 这样可以代替提供index.html文件等。它将提供index.php文件。
See: https://serverfault.com/questions/286882/apache-is-not-interpreting-php-files 参见: https : //serverfault.com/questions/286882/apache-is-not-interpreting-php-files
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.