0

ここで何が起こっているのか正確にはわかりませんが、権限に問題があると思います。私は症状を説明しようとしますが、うまくいけば誰かが治療を受けますか? EC2 インスタンスでウェブサイトを実行しようとしています。このガイドに従ってランプをインストールしました: https://gist.github.com/aronwoost/1105007。Web サイトでは、php、mysql、javascript を使用しています。PHPファイルからクエリを実行することでmysqlデータベースにアクセスできることがわかりましたが、正しく機能しないことがたくさんあります。

  1. 「include 'databaseinfo.php';」を使用すると、変数をインポートする代わりにファイルの内容が自動的に出力されるため、より安全な mysql クエリを作成できます。
  2. メインの index.html ファイルには、いくつかの php コードがあり、いくつかの html をエコーし​​て実行しようとしますが、代わりに html は実際に実行されるのではなく、テキストとしてエコーされます。

編集: httpd.conf に対して行った唯一の変更は、このセクションです。

<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All
4

1 に答える 1

1

MIME タイプの問題のようです。これを .htaccess (またはメインの apache conf) に追加できます。

 AddType application/x-httpd-php .php .html
于 2014-02-24T20:14:43.577 に答える