私はラズベリーパイにApacheサーバーをインストールしました。そして、私はPHPを提供しようとしない限り、すべて正常に動作しているようです。apacheはどんなPHPも動かすことができません
/var/www/html/index.html serves fine
/var/www/html/foo/index/index.html serves fines
しかし、私はindex.phpを追加した場合、のは言わせて:
<?php echo "hello world"; ?>
私がアクセス/ var/www/htmlと設定によって403 -Forbbidenを取得するが、私はまだ/の/ var/WWWにアクセスすることができますhtml/foo/index.html(DirectoryIndexは.php .html .htmに設定されています)。
そして、私は$php index.php
実行する場合:だからHello Worldの
を、缶が.htmlのに役立つことは、それが.PHP実行することができないが、それは.PHP仕えることはできません。
どうすればこの問題を解決できますか?私は多くの解決策を見つけましたが、誰も私のために働きませ
注: 私はLANからサイトにアクセスします。 サーバーのOS(のuname -a):GNU/Linuxの
armv7lのLinux raspbian-AH 4.1.19-V7 +#858 SMP火3月15日夜03時56分00秒GMT 2016コメントで述べたように、我々は簡単にモジュールを導き出すことができロードされたが、私はここにあるされていません。
[email protected]:/etc/apache2/mods-available $ cat php5.conf
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Require all denied
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(p[345]?|t|tml|ps)$">
Require all denied
</FilesMatch>
# Running PHP scripts in user directories is disabled by default
#
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_flag engine Off
</Directory>
</IfModule>
とphp5.load:dan08へ
[email protected]:/etc/apache2/mods-available $ cat php5.load
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
が鳴ります。 – Jhecht
そのファイルは私のファイルシステム上に存在しませんが(findでテストします)、私は/etc/apache2/apache2.confが私の名前だと思いますか? –
あなたはどのようなLinuxディストリビューションを使っていますか? – Jhecht