Welcome Guest, Not a member yet? Register   Sign In
Basic Question
#1

[eluser]dobbypat[/eluser]
Hi, I'm new to Codeigniter and PHP. I was running through the 'Hello World' tutorial to help familiarize myself with CI and PHP. In the first portion of the tutorial you create a basic controller file. When I did this and loaded it to my site I didn't get an error message but I did get a blank white screen. I went to the next step where you create the view file and completed this. I also changed the routes file to point to this blog file but I'm still getting the blank page. When I attempted to type in the entire path to see if I could see the file then I receive the following error:

Fatal error: Class 'Controller' not found in /home/content/d/o/b/dobbypat/html/system/application/controllers/blog.php on line 3

Has anyone run into this before?

Thanks
#2

[eluser]Cro_Crx[/eluser]
Hey dobbypat

Could you please post the contents of your blog.php file in the controllers directory. Also any ideas what web server are you running? Apache or IIS?

You could be receiving a blank page because an error is being generated but your web server has error logging off. You'll want to turn on error display in your web server if possible.
#3

[eluser]dobbypat[/eluser]
Sure.

<?php

class Blog extends Controller {


function index()
{
echo 'Hello World';
}
}

?>
#4

[eluser]Cro_Crx[/eluser]
Ya.... you need a Blog function! Add this above your index function:

Code:
function Blog()
    {
        parent::Controller();
    }
#5

[eluser]dobbypat[/eluser]
I tried doing what you said but I'm still having the same problem. My code may be incorrect. This is what I used. Is it correct?


<?php

class Blog extends Controller {
function Blog()
{
parent::Controller();
}

function index()
{
echo 'Hello World';
}
}

?>
#6

[eluser]dobbypat[/eluser]
The server is an Apache server. I was able to allow error logs. I tried to open the blog.php file by typing http://www.mywebsite.com/index.php/blog/ and I still get the blank page. Then I attempted to open the blog.php file by typing the complete path to the file
http://www.mywebsite.com/system/applicat...s/blog.php to see if I could view it that way and I still get the fatal error message. The error log file produces the following errors:

[Sun Jul 12 12:27:21 2009] [error] [client 68.82.27.80] client denied by server configuration: /web/icons/blank.gif
[Sun Jul 12 12:27:21 2009] [error] [client 68.82.27.80] File does not exist: /var/chroot/home/content/d/o/b/dobbypat/html/missing.html
[Sun Jul 12 12:27:21 2009] [error] [client 68.82.27.80] client denied by server configuration: /web/icons/unknown.gif
[Sun Jul 12 12:27:21 2009] [error] [client 68.82.27.80] File does not exist: /var/chroot/home/content/d/o/b/dobbypat/html/missing.html
[Sun Jul 12 12:27:21 2009] [error] [client 68.82.27.80] client denied by server configuration: /web/icons/back.gif
[Sun Jul 12 12:27:21 2009] [error] [client 68.82.27.80] File does not exist: /var/chroot/home/content/d/o/b/dobbypat/html/missing.html


Any suggestions? I'm at a loss. Thanks
#7

[eluser]ecsyle31[/eluser]
Are you sure you uploaded everything in the system directory?

Edit: Nevermind, doesn't seem to be the problem. What version of PHP? Are the file permissions correct?
#8

[eluser]tenisujin[/eluser]
Hello. I am having the same problem of not being able to refernece my css file. I have been looking for posts about resolving this problem but this ticket is the closest i've seen and it appears never to have been answered. Does anyone have any suggestions? any help would be appreciated.

this is my error message
client denied by server configuration: /Users/NVT/Localhost/tut01/application/css/style.css, referer: http://localhost/tut01/index.php/blog/clients

this is my css ref:
<link rel="stylesheet" href="<?php echo base_url();?>application/css/style.css" type="text/css" media="screen" />

this is the baseurl in my controller:
$config['base_url'] = 'http://localhost/tut01/index.php/blog/';
#9

[eluser]hmayag[/eluser]
[quote author="tenisujin" date="1310936614"]
this is the baseurl in my controller:
$config['base_url'] = 'http://localhost/tut01/index.php/blog/';[/quote]

Hi tenisujin, it seems to me that your base_url is incorrect. You are forcing a call yo the blog. Remove the part after tut01

I hope this helps.
#10

[eluser]tenisujin[/eluser]
Hello. Thanks for the quick response. I tried it with no success. Do you know of a way to debug ?




Theme © iAndrew 2016 - Forum software by © MyBB