CodeIgniter 3不能在LAMP上工作
问题描述:
我有在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]
答
首先你检查服务器配置。你可以使用apache错误日志来查找与服务器相关的问题。 然后检查应用程序的错误日志。 在database.php中检查
'dbdriver' => 'mysqli',
,因为最新的灯,不支持在虚拟主机文件
'dbdriver' => 'mysql',
设置服务器名。您在基本网址末尾忘记了斜线。它是否适用于url中的index.php? – Tpojka
控制器(和型号)文件名以大写字母开头? – DFriend