1

我已经在我的 Mac 上通过 Cyber​​duck 使用 Vagrant 设置了本地服务器。出于某种原因,除了 php 文件之外,一般运行文件似乎没有问题(我猜?)。它只是显示我输入的内容,即

<?php
echo "hello from Vagrant";

而不是说hello from Vagrant 我也做了sudo vi /etc/httpd/conf.d/php.conf,看看似乎是什么导致了这个问题。

# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>

<IfModule !prefork.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>

#
# The following lines prevent .user.ini files from being viewed by Web clients.
#
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
Satisfy All
</IfModule>
</Files>

#
# Allow php to handle Multiviews
#
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

# mod_php options
<IfModule  mod_php5.c>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.php$>
#    SetHandler application/x-httpd-php-source
#</FilesMatch>

这里还有一些关于我迄今为止使用的软件版本的快速信息。PHP 5.6.15 Apache 2.2.15 CentOS 6.7 Cyber​​duck 4.7.3

任何人都知道任何解决方案?先感谢您!

4

0 回答 0