⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

newbie: cannot get examples to work



JustMe
  • profile picture
  • Member

Posted 06 March 2013 - 22:23 PM

Hello.

Not sure at all what is wrong. This URL works: http://localhost/ci/CodeIgniter_2.1.3/index.php

 

I unzipped CI and GC. Modified the database.php and config.php and created the example mysql tables.

 

I assume it is a path issue. In other words I unzipped things wrong?

I attached a tree of my directory and files.. 

 

Hopefully someone can shed light on my mistake.

Thanks

Bg

 

 

I am using this as a URL.

http://localhost/ci/CodeIgniter_2.1.3/application/views/example.php

 

I am getting these errors.

 

[Wed Mar 06 17:10:55 2013] [error] PHP Notice:  Undefined variable: css_files in /var/www/ci/CodeIgniter_2.1.3/application/views/example.php on line 6
[Wed Mar 06 17:10:55 2013] [error] PHP Warning:  Invalid argument supplied for foreach() in /var/www/ci/CodeIgniter_2.1.3/application/views/example.php on line 6
[Wed Mar 06 17:10:55 2013] [error] PHP Notice:  Undefined variable: js_files in /var/www/ci/CodeIgniter_2.1.3/application/views/example.php on line 9
[Wed Mar 06 17:10:55 2013] [error] PHP Warning:  Invalid argument supplied for foreach() in /var/www/ci/CodeIgniter_2.1.3/application/views/example.php on line 9
[Wed Mar 06 17:10:55 2013] [error] PHP Fatal error:  Call to undefined function site_url() in /var/www/ci/CodeIgniter_2.1.3/application/views/example.php on line 31
 
 
 

sachin vairagi
  • profile picture
  • Member

Posted 07 March 2013 - 05:03 AM

if you set up GC correctly then your URL should be as follows
http://localhost/ci/CodeIgniter_2.1.3/index.php/examples

Here 'examples' is the controller inside zipped GC, make sure you have import examples_database.sql in your database.
To set up GC, unzip GC file, put all the file from grocery crud to the corresponding folders in your localhost/ci/CodeIgniter_2.1.3 folder.
import examples_database.sql in your dabase then try following URL
http://localhost/ci/CodeIgniter_2.1.3/index.php/examples
 


JustMe
  • profile picture
  • Member

Posted 07 March 2013 - 09:52 AM

Hi Sachin101.

 

http://localhost/ci/CodeIgniter_2.1.3/index.php/examples does not work. I get a 404 error.

Looking in my apache2 logs I get 

 

File does not exist: /var/www/ci/CodeIgniter_2.1.3/index.php/examples
 

Thanks.

 

mkdir /var/www/ci

cp CodeIgniter_2.1.3.zip /var/www/ci

unzip CodeIgniter_2.1.3.zip

 

cp grocery_CRUD-1.3.3.zip 

/var/www/ci/CodeIgniter_2.1.3

unzip grocery_CRUD-1.3.3.zip 

 

vi application/config/config.php

vi application/config/database.php


JustMe
  • profile picture
  • Member

Posted 07 March 2013 - 12:09 PM

problem solved.

I copied the exact same setup (did a tar ball) from my Ubuntu server to my hosted Centos server.

It worked on the Centos server.. Not sure why it did not work on Ubuntu.

 

Thanks