ローカル開発環境からブラウザでphpを表示できない(解決済み)
もともとunixコマンドの勉強をしようとドットインストールを見ていたのだけれども「ローカル開発環境?え?なにそれ?それやってる前提で始めるの?」ってことでローカル開発環境の構築 [MacOS X編]っていうのを見てたのだが、"Hello from Vagrant!"と書かれたphpファイルをローカル開発環境で表示させようとすると、
index.php
<?php
echo "hello from Vagrant!";
とそのまま表示されてしまう。
どういうことなのかと色々と調べた結果、ローカル開発環境からブラウザでphpファイルを確認できないという名前のforumを発見。同志よ。と思い色々と試した結果、未だに動きません。ちなみにPHP 5.5.29 CentOS 6.7 apache2.2.15
です。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 \.phps$>
SetHandler application/x-httpd-php-source
</FilesMatch>
Apache specific PHP configuration options
those can be override in each configured vhost
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"
php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache"
</IfModule>
ということで未だに沼の中。。。
Author And Source
この問題について(ローカル開発環境からブラウザでphpを表示できない(解決済み)), 我々は、より多くの情報をここで見つけました https://qiita.com/weedslayer/items/5bed44dca5208394b650著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .