Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何解决php不能运行的问题?_Php - Fatal编程技术网

如何解决php不能运行的问题?

如何解决php不能运行的问题?,php,Php,我刚刚安装了php7.0,但在通过访问时无法在浏览器上看到 localhost/info.php 当我在/var/www/html/info.php中有一个文件时 <?php phpinfo();?> 请帮助解决此问题?您尝试过ssh吗? 在终端中尝试php-v。检查apache2 conf文件。它可以是/etc/httpd/conf或/etc/apache2/conf或类似的格式 在目录标签中应该有一个路径。如果这是真的,但仍然不起作用,请将这些添加到conf文件的末尾 Do

我刚刚安装了php7.0,但在通过访问时无法在浏览器上看到

localhost/info.php

当我在/var/www/html/info.php中有一个文件时

<?php phpinfo();?>

请帮助解决此问题?

您尝试过ssh吗?
在终端中尝试php-v。

检查apache2 conf文件。它可以是/etc/httpd/conf或/etc/apache2/conf或类似的格式

在目录标签中应该有一个路径。如果这是真的,但仍然不起作用,请将这些添加到conf文件的末尾

DocumentRoot /var/www/html
<Directory /var/www/html>
    AllowOverride None
    Order Allow,Deny
    Allow from All

    <IfModule mod_rewrite.c>
        Options -MultiViews
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ app.php [QSA,L]
    </IfModule>
</Directory>

# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeScript assets
# <Directory /var/www/project>
#     Options FollowSymlinks
# </Directory>

ErrorLog /var/log/httpd/custom_error.log
CustomLog /var/log/httpd/custom_access.log combined

DocumentRoot/var/www/html
不允许超限
命令允许,拒绝
通融
选项-多视图
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$app.php[QSA,L]
#如果将资产安装为符号链接,请取消注释以下行
#或者在编译较少的/Sass/CoffeScript资产时遇到问题
# 
#选项如下符号链接
# 
ErrorLog/var/log/httpd/custom_error.log
CustomLog/var/log/httpd/custom_access.log组合

我想您应该尝试使用“localhost/html/info.php”而不是“localhost/info.php”,因为您需要在url中正确指定www文件夹中的路径,以便可以找到该文件。

确保您的Web服务器已安装。如果您尝试重新设置systemctl Apache2,则需要设置环境变量。在网上查一下,你会得到很多解决办法。回音怎么样?例如:回声“测试”@Fahrudinyuniwinato仍然没有成功不,PHP 7.0.4-7ubuntu2.1(cli)(NTS)版权所有(c)1997-2016 PHP组Zend Engine v3.0.0版权所有(c)1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev版权所有(c)1999-2016 Zend Technologies只是想看看服务器是否在运行,感谢否决票(y)顺便说一下,您不需要添加ifmodule部分。您提到的方法不会成功