CodeIgniter Forums
Can't install CI... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Can't install CI... (/showthread.php?tid=31624)



Can't install CI... - El Forum - 06-26-2010

[eluser]clueliss[/eluser]
Sorry for being such a noob but I tried to install CI and I got this error:

Fatal error: Call to a member function num_rows() on a non-object in C:\Apache2\htdocs\sitesite\system\libraries\Session.php on line 209

I am running on windows, in LAMP stack with MySQL - 5.0.22-community-nt & phpMyAdmin - 2.8.1


Can't install CI... - El Forum - 06-28-2010

[eluser]danmontgomery[/eluser]
you have database sessions enabled but the query to fetch the session from the database is failing. Make sure you have set $config['sess_table_name'] in config.php, and that the table exists with the proper structure:

http://ellislab.com/codeigniter/user-guide/libraries/sessions.html


Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id)
);



Can't install CI... - El Forum - 06-29-2010

[eluser]clueliss[/eluser]
Thanks but your suggestion did not work.


Can't install CI... - El Forum - 06-30-2010

[eluser]WanWizard[/eluser]
Is the database loaded? And properly configured?


Can't install CI... - El Forum - 07-19-2010

[eluser]clueliss[/eluser]
Here is the latest error I am getting now...

A PHP Error was encountered

Severity: Warning

Message: mysql_errno(): supplied argument is not a valid MySQL-Link resource

Filename: mysql/mysql_driver.php

Line Number: 453

and

A PHP Error was encountered

Severity: Warning

Message: mysql_error(): supplied argument is not a valid MySQL-Link resource

Filename: mysql/mysql_driver.php

Line Number: 440


What really irks me is that this custom app using CI 1.7.2 worked great on my friends laptop but has been giving me fits on mine. Anyone know of a suggestion to rectify this matter for me?


Can't install CI... - El Forum - 07-23-2010

[eluser]Derek Allard[/eluser]
Welcome to CI clueliss. Sorry this has to be your first experience with CI. Hope you'll stick around after we get this sorted.

Quote:Is the database loaded? And properly configured?

This is really the key question I think. Do you have a database set up? Is it running correctly?

Let's remove your app from the equation. Set up this test controller. Save this as application/controllers/test.php and visit it.

Code:
<?php

class Test extends Controller {
    
    function index()
    {
        $this->load->database();

        $tables = $this->db->list_tables();

        if (count($tables) > 0)
        {
            foreach ($tables as $table)
            {
               echo "table $table found<br>";
            }
        }
        else
        {
            echo "no tables";
        }
    }
}



Can't install CI... - El Forum - 07-23-2010

[eluser]WanWizard[/eluser]
I noticed that CI shows similar bahaviour when you're missing the php mysql extensions.

Check if you have them installed. phpinfo() might help out, you need a MySQL section in the output, and MySQL should be enabled.


Can't install CI... - El Forum - 07-23-2010

[eluser]clueliss[/eluser]
Hi Derek.

I created the page as you outlined and placed it in the folder as stated.

Here's my path:
http://localhost/cms/contents/system/application/controllers/test.php

Here's my new error message:

Fatal error: Class 'Controller' not found in C:\Apache2\htdocs\cms\contents\system\application\controllers\test.php on line 3


Can't install CI... - El Forum - 07-23-2010

[eluser]WanWizard[/eluser]
You don't put the directory path inside the docroot in the URL, as you would with static HTML pages. The directory structure inside a CI application is not visible to your visitors.

The structure is: [host]/[path_to_index.php]/[controller]/[method]/[parameters].

So in this case the URL would be: http://localhost/cms/contents/test. Or http://localhost/cms/contents/index.php/test if you don't have mod_rewrite working yet, which from looking at the error message you haven't.

I suggest spending some time to read the user manual again, to get more acquainted with the way CI operates, which components are needed, and how you should set things up.


Can't install CI... - El Forum - 07-23-2010

[eluser]clueliss[/eluser]
Update:

I modified the code on the page application/config/database.php to have the password included and my CI sort of works now. The only thing I have left to do is figure out how to correct the CSS.