2017-04-13 86 views
0

我有在MAMP本地運行的CodeIgniter 3就好了。但是,當我從我的回購拉,並嘗試將其設置與安裝LAMP EC2實例,我得到一個404 CodeIgniter的是在/var/www/html文件夾CodeIgniter 3不能在LAMP上工作

/etc/apache2/apache2.conf文件包含以下內容:

<Directory /> 
    Options FollowSymLinks 
    AllowOverride All 
</Directory> 

<Directory /usr/share> 
    AllowOverride None 
    Require all granted 
</Directory> 

<Directory /var/www> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Require all granted 
</Directory> 

mod_rewrite已啓用。該文件/etc/apache2/sites-available/000-default.conf如下:

<VirtualHost *:80> 
    AccessFileName .htaccess 
    ServerAdmin [email protected] 
    DocumentRoot /var/www/html/ 

    <Directory /> 
      AllowOverride All 
      Order allow,deny 
      allow from all 
    </Directory> 

    <Directory /var/www/html/> 
      Options Indexes FollowSymLinks MultiViews 
      AllowOverride All 
      Order allow,deny 
      allow from all 
    </Directory> 

    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

文件/var/www/html/application/config/config.php具有以下設置:

$config['index_page'] = ''; 
$config['base_url'] = 'http://baseurl.com'; 

.htaccess文件如下:

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
+0

設置服務器名。您在基本網址末尾忘記了斜線。它是否適用於url中的index.php? – Tpojka

+0

控制器(和型號)文件名以大寫字母開頭? – DFriend

回答

0

首先你檢查服務器配置。你可以使用apache錯誤日誌來查找與服務器相關的問題。 然後檢查應用程序的錯誤日誌。 在database.php中檢查

'dbdriver' => 'mysqli', 

,因爲最新的燈,不支持在虛擬主機文件

'dbdriver' => 'mysql', 
相關問題