1

I've set up a local server with Vagrant via Cyberduck on my Mac. There seems to be no problem with running a file in general (I guess?) except for php file for some reason. It simply shows what I typed in, which is

<?php
echo "hello from Vagrant";

instead of saying hello from Vagrant I also did sudo vi /etc/httpd/conf.d/php.conf and see what seems to be the problem that's causing this.

# 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>

Also here's some quick info about my software version that I've used so far. PHP 5.6.15 Apache 2.2.15 CentOS 6.7 Cyberduck 4.7.3

Anyone knows any solution to this? Thank you in advance!

0 Answers0