【发布时间】:2017-07-06 05:51:47
【问题描述】:
将我的应用设置为 EC2 实例,我有以下虚拟主机:
<VirtualHost *:80>
ServerName melomaniacs.com
## Vhost docroot
DocumentRoot "/var/www/html/myProject/web"
DirectoryIndex app.php
## Directories, there should at least be a declaration for /var/www/html/myProject/web
<Directory "/var/www/html/myProject/web">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from All
Satisfy Any
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
</Directory>
## Logging
ErrorLog "/var/log/httpd/melomaniacs_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/melomaniacs_access.log" combined
## Server aliases
ServerAlias *.melomaniacs.com
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
## Custom fragment
</VirtualHost>
但是当我尝试访问 app.php(当我访问 IP 时)时,我将其内容作为纯文本获取:
loadClassCache(); $kernel = new AppCache($kernel); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter //Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);
更新: 刚刚尝试在 httpd.conf 中添加以下行:
LoadModule php7_module modules/libphp7.so
但它说:
[warn] module php7_module is already loaded, skipping when restarting apache.
我尝试了许多可能的配置,但我无法得到它,知道发生了什么吗?
【问题讨论】:
标签: php apache symfony symfony-3.1