自分が何をしているのかわからないような気がします。
私の CodeIngiter アプリケーションは、次の URL を使用して WAMP で正常に動作しています: http://localhost/myapp
。
しかし、それを AWS EC2 マイクロ インスタンス Amazon Linux AMI に移動し、/var/www/html/myapp
この URL を使用してアプリケーションにアクセスしようとするhttp://xxx-xxx-xxx-xxx-xxx.compute-1.amazonaws.com/myapp
と、空白の白いページしか表示されません。
ここに私が試したすべてがあります:
1.「のインデックス」表示を無効にしました
cd /etc/httpd/conf/
sudo nano httpd.conf
オプション -Indexes FollowSymLinks
2. php.ini でエラー報告をオンにしました
error_reporting = E_ALL | E_STRICT
display_errors = オン
3. 開発環境
(アプリケーション
のindex.php
ルート) で、
define('ENVIRONMENT', 'development');
4. Apache
cd /etc/init.d
sudo httpd -k restart を再起動します 。
5.ドキュメントルート
DocumentRoot "/var/www/html/"
また試しました:
DocumentRoot "/var/www/html"
DocumentRoot "/var/www/html/myapp"
6. index.php からのエコー テスト
index.php
(アプリのルート) とコントローラーの両方からテスト メッセージを出力しました。どちらも機能しました。ビューが表示されない理由がわかりません。
<?php echo "test"; ...
//This worked.
7. www/html/myapp
置き換え www/html/
アプリケーションのコンテンツを「myapp」フォルダーの外にあるwww/html
ディレクトリに移動しました。また、DocumentRoot "/var/www/html/"
. また、(myapp のルートにある)私の.htaccess"RewriteBase /"
ファイルは(以下のポイント 8 を参照) です。
また、同じ空白ページから.htaccessを削除しました。/var/www/html/
8. .htaccess
次の.htaccess
ファイルは、CodeIgniter アプリケーションのルートにあります。に変更も試み
RewriteBase /myapp
ましRewriteBase /
たが、まだこの空白のページがエラーなしで表示されています。
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/, use /
# If your URL is www.example.com/site_folder/, use /site_folder/
RewriteBase /myapp
# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For reuests that are not actual files or directories,
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
何を再試行すればよいかわかりません。