Yesterday I spent more than 5 hours trying to figure out what happened to my setup. In the ci213 / application / controllers and views directories, I have a simple site.php and test.php controller. I do not understand why this site is not loading. Anyone have any suggestions on what I could look for next? Maybe it works correctly? If I could improve log errors, with which I could work more.
I decided that this should be something with codeigniter, since I have index.php and index.html in apache root (/ var / www), as well as index2.php on root sites (/ var / www / vhosts / srp-local / htdocs) when I go to localhost / index. (php | html) or srp-local / index2.php, pages load and display correctly, so php and apache work.
Trying to load the site, I get a blank page, so I decided that it should be something with CI. I close all log files, and the only one who receives the update is access.log with the following error.
127.0.0.1 - - [23/Mar/2013:09:00:28 -0600] "GET / HTTP/1.1" 500 381 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0"
config.php
$config['base_url'] = 'http://srp-local/';
Controllers / site.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Site extends CI_Controller { public function index() { $this->load->view('test'); } }
view / test.php
<html> <head> </head> <body> <?php echo "PHP is working and the 'test' view was loaded"; ?> </body> </html>
Apache root
/var/www/vhosts $ ll drwxrwsr-x 6 krizzo www-data 4096 Mar 22 10:45 it355 drwxrwsr-x 6 krizzo www-data 4096 Mar 22 17:45 srp-local
htdocs is webroot for srp-local, and index.php refers to the ci213 folder.
/var/www/vhosts $ ll srp-local/ drwxrwsr-x 2 krizzo www-data 4096 Mar 22 17:06 cgi-bin drwxrwsr-x 4 krizzo www-data 4096 Mar 22 17:14 ci213 drwxrwsr-x 2 krizzo www-data 4096 Mar 22 17:19 logs drwxrwsr-x 5 krizzo www-data 4096 Mar 22 17:26 htdocs
All log locations / permissions
/var/log/apache2/ -rw-rw-rw- 1 www-data adm 0 Mar 23 08:52 php_errors.log -rw-r----- 1 root adm 12191 Mar 23 09:32 access.log -rw-r----- 1 root adm 4858 Mar 23 09:32 error.log /var/www/vhosts/srp-local/logs/ -rw-r--r-- 1 root www-data 3227 Mar 22 19:42 error.log -rw-rw-r-- 1 krizzo www-data 0 Mar 23 09:37 ci_error.log -rw-r--r-- 1 root www-data 12983 Mar 23 09:38 access.log
Php.ini file settings
error_reporting = E_ALL & ~E_DEPRECATED log_errors = On error_log = /var/log/apache2/php_errors.log