LAMP和PHP问题 [英] LAMP and PHP Issue

查看:92
本文介绍了LAMP和PHP问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正常工作的LAMP服务器(我认为).当我将服务器的IP地址输入到firefox中时,得到的图片显示在此页面上.

I have a working LAMP server ( I think). When I enter the server's ip address into firefox I get the picture shown on this page.

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04

这使我相信一切都很好.但是在放置PHP文件的目录(/var/www/html)中,我放置了两个文件. Hello.php,其中包含:

This leads me to believe everything is fine. But in my directory where PHP files are to be placed (/var/www/html) I have placed two files. Hello.php which contains:

<html>
 <head>
   <title>PHP Test</title>
   </head>
   <body>
   <?php echo '<p>Hello World</p>'; ?> 
   </body>
  </html>

如果我将我的IP地址输入到firefox中,则/hello.php可以看到输出"Hello World".第二个文件/info.php包含:

If I type my IP address into firefox then /hello.php the output "Hello World" is visible. The second file, /info.php, contains:

<?php phpinfo();?>

当我尝试IP地址后跟/info.php时.我得到了一个空白的空白屏幕,没有任何输出.在我的httpd.conf文件中,添加了(LoadModule php7_module modules/libphp7.so).如果我转到/etc/apache2/mods-available,则该目录中没有php模块(不确定是否应该存在).

When I try IP address followed by /info.php. I get a blank white screen with no output. In my httpd.conf file I have added (LoadModule php7_module modules/libphp7.so). If I go to /etc/apache2/mods-available there are no php modules in this directory (not sure if there should be).

我是服务器和PHP的新手.我正在运行apache2,php 7.0.6和Ubuntu 12.04.

I am new to servers, as well as PHP. I am running apache2, php 7.0.6 and Ubuntu 12.04.

如果需要其他信息,请询问.谢谢.

If there is any other information needed please ask. Thank you.

推荐答案

尝试仅包含此内容的PHP页面:

Try a PHP page with only this in it:

<?php
error_reporting(E_ALL);
phpinfo();
?>

如果有,请查看客户端调试器(Firebug等),或查看apache日志.

Look at your client-side debugger (Firebug, etc.) if you have one, or look at your apache logs.

这篇关于LAMP和PHP问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆