⚠ 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

Problem with basic tutorial



Seffy

Seffy
  • profile picture
  • Member

Posted 07 February 2014 - 13:04 PM

Dear all,

I started to use grocerycrud just yesterday and I followed tutorials to install codeigniter and grocerycrud.

I followed the instruction of basic tutorial, I created my DB, my tables and the suggested main controller.

But I experienced problem with the web graphic. I can't see the table theme described in the tutorial, it seems that it can't load the css/jss files.

I attached a screenshot of my web result.

 

[attachment=760:to_grocerycrud_forum.png]

 

I searched on the forum and I found this post

/topic/2048-theme-assets-not-loading/

that seems quite similar to my problem, but actually didn't solve my problem and then I have my .htaccess file correct.

 

I am using codeIgniter vers. 2, grocerycrud vers. 1.4-2.1 running on Mac OS X vers. 10.9.1

 

Does anyone could help me?

Thanks


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 08 February 2014 - 05:41 AM

Hi Seffy

 

Welcome to GC Forums. Can you share your development / serve environment ... like wt u using xampp / wamp .. etc.

Secondly will recommend u using Firefox - install firebug, enable net / console in firebug and see all the links / references that are being shown up in red / 404 -

It will be failing to load the css and stuff - check the url as it shows up in as net call and see if the path / file dose exists or not.

If u have properly configured .htaccess for rewrite rules... it should usually not give problem. But if u have issues with rewrite rules - it surely seems your rewrite module is not loaded correctly.

U can share screenshots of firebug net access or console where it shows up the urls of the files missing and the status as 404 or whatever.

 

Happy GCing :)


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 09 February 2014 - 23:34 PM

Hello [member='Seffy'],

 

It is pretty clear of your screenshot that the javascripts and the CSS didn't load. So I can guess two things:

- You forgot to load the CSS and JS in your template. There is a step by step installation guide on how to install grocery CRUD to your website at: http://www.grocerycrud.com/documentation/create-crud-codeigniter-tutorial . I guess that you already did that, but please follow the instructions and tell us where did you stack. In which step do you think that your project doesn't work?

- The assets folder is somekind of hidden because of an .htaccess that you have. Can you please share with us your HTML page source so we can understand more of your issues? Please copy your HTML code to: https://gist.github.com/ so it can be more readable. Also as [member='Amit Shah'] mentioned, can you please share with us your .htaccess file? I bet that this is an .htaccess issue :)

 

I am also using the same version of MAC OS and I didn't have any issues when I've installed MAMP.

 

Cheers
Johnny


Seffy

Seffy
  • profile picture
  • Member

Posted 10 February 2014 - 12:23 PM

Dear all,

thank for the answer and sorry for my late reply!!

 

@Amit I am using Apache 2.2.24 version, PHP version 5.4.17 and MySQL version 5.6.16.

I didn't use XAMP, MAMP o any other. MAC OSX already has PHP and APACHE so I simply installed MySQL. Is it correct or I have to install MAMP ?

I installed as you suggested, Firefox and I enabled the console. It seems that it could not find the directories under asset main directory but when I looked at my site directory I see every dir and file. I attached 3 screen shot: console and the path for the first two error of the console.

 

[attachment=763:Screen Shot 2014-02-10 at 13.17.02.png]

[attachment=764:Screen Shot 2014-02-10 at 13.18.46.png]

[attachment=765:Screen Shot 2014-02-10 at 13.19.31.png]

 

My .htaccess file is:

 

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php/$0 [PT,L]

 

I used the suggestions of this post http://www.grocerycr...ts-not-loading/.

 

@web-jhonny

I used exactly the tutorial that you suggested and it didn't work since step 7. I save the template and when I look at the result I see the graphics as I described in the first post.

This is my source code:

https://gist.github.com/anonymous/8915372

 

Thanks for helping me!!

 

 


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 10 February 2014 - 21:38 PM

Hello [member='Seffy']

 

Now I am sure about your issue. The problem is with the .htaccess . If you follow the steps as I will tell you at the end you will have for sure success :)

 

So we need to make sure that this is an .htaccess issue . So first rename the .htaccess to .htaccess-old . So now that we don't use the .htaccess we need to go to: application/config/config.php and make sure that you have:

$config['index_page'] = 'index.php';

Once you do that then go again to your grocery crud folder and see the results. Probably now the problem is solved. If your problem is solved then we can continue and see how you will add your .htaccess file correctly. If you still have issues then we need to do some configurations to your apache configurations as well in order to fix your issue. Please let me know if this worked for you and then we can continue with the configurations of the apache server.


Seffy

Seffy
  • profile picture
  • Member

Posted 11 February 2014 - 08:34 AM

Hi Johnny,

I renamed the file and I have 

$config['index_page'] = 'index_php';

in my config.php.

I also restarted my apache web server with:

sudo apachectl restart

But the problem still remain :(

No CSS loaded... :(

 


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 11 February 2014 - 12:21 PM

Hello Seffy,
 
Don't worry we are almost there! So as far as I can see from your HTML page source there is a problem with your base_url . Can you please give us the URL that you are using in order to have your expected results? For example in my local with MAMP I am using the url http://locahost:8888/grocery-crud/ , in my simple apache configuration I am using: http://localhost/grocery-crud . What I am trying to say is that probably Codeigniter didn't recognized properly your base_url. What you should do is: Go to application/config/config.php and search for base_url and make sure that you have the url that you are actually using. For example, if your URL looks like this:
$config['base_url'] = '/game-paths/';
 
As you can see you can just copy the URL before the index.php actually!
 
So for example, if your URL looks like this:
http://localhost/game-paths/test-project/index.php/examples/games
then your base_url should look like this:
 
$config['base_url'] = '/game-paths/test-project/';
or:
$config['base_url'] = 'http://localhost/game-paths/test-project/';
 
I think this will solve your problem  ;)

Seffy

Seffy
  • profile picture
  • Member

Posted 11 February 2014 - 15:00 PM

Hello Johnny,

and thanks a lot for all the suggestions!! :)

My URL is under my home directory and I have in application/config/config.php the line:

$config['base_url']     = '/Users/seffy/Sites/';

My index.php is under

AirSeffy:Sites seffy$ ls /Users/seffy/Sites/index.php 
/Users/seffy/Sites/index.php

So I think that it is all correct, right?

If yes I don't have to change anything in my configuration and so we didn't find the solution :(

Otherwise probably I have to change the location of my Sites directory...


kenshicu

kenshicu
  • profile picture
  • Member

Posted 11 February 2014 - 16:12 PM

Hi, I recommend to you, in Firefox, to press Ctrl+U in your site, to review the generated code. In special this:
<link type="text/css" rel="stylesheet" href="Route_of_file_CSS" />
check this: "Route_of_file_CSS"

And try it: $config['base_url']    = "";

And... finally smile


Seffy

Seffy
  • profile picture
  • Member

Posted 11 February 2014 - 16:47 PM

Dear kenshicu,

It works!!

Great!!

 

Thanks!!

 

Now I am smiling!! :D

Thanks a lot!!!!


kenshicu

kenshicu
  • profile picture
  • Member

Posted 11 February 2014 - 17:07 PM

Good for you!! ;)