redbaron76 / PongoCMS-Laravel-cms-bundle

a CMS bundle for Laravel 3.2 and Twitter Bootstrap 2.2.0
http://pongocms.com
Other
100 stars 32 forks source link

Undefined offset: 1 #12

Closed ktee55 closed 11 years ago

ktee55 commented 11 years ago

I followed your instruction and when I access http://localhost/pongocms/public/, the error says:

/-------------------------------------------------------------------/

Unhandled Exception

Message:

Undefined offset: 1 Location:

C:\xampp\htdocs\pongocms\bundles\cms\libraries\utilities.php on line 159 Stack Trace:

0 C:\xampp\htdocs\pongocms\laravel\laravel.php(42): Laravel\Error::native(8, 'Undefined offse...', 'C:\xampp\htdocs...', 159)

1 C:\xampp\htdocs\pongocms\bundles\cms\libraries\utilities.php(159): Laravel{closure}(8, 'Undefined offse...', 'C:\xampp\htdocs...', 159, Array)

2 C:\xampp\htdocs\pongocms\bundles\cms\routes.php(48): CmsUtility::url_segments()

3 [internal function]: Laravel\Bundle::{closure}()

4 C:\xampp\htdocs\pongocms\laravel\routing\filter.php(119): call_user_func_array(Object(Closure), Array)

5 C:\xampp\htdocs\pongocms\laravel\routing\route.php(120): Laravel\Routing\Filter::run(Array, Array, true)

6 C:\xampp\htdocs\pongocms\laravel\laravel.php(167): Laravel\Routing\Route->call()

7 C:\xampp\htdocs\pongocms\public\index.php(34): require('C:\xampp\htdocs...')

8 {main}

/-------------------------------------------------------------------/

Then, I tried to change $segments[1] on line 159 to $segments[0], everything looks fine.

Admin area looks all fine from the beginning, without changing anything. I mean under http://localhost/pongocms/public/cms/ directly. I can login and hang around the area.

When I use virtual host, directing http://localhost/pongocms/public/ to http://pongocms.dev/ , the situation in public area is the same. The difference is trying to access http://pongocms.dev/cms/ , it redirect to http://localhost/pongocms/public/cms/login/ and says 404 error.

Actually, all pages under http://localhost/pongocms/public/ says 404 error when I use virtual host; that's weird.

Here's the tree in my directly: http://www.flickr.com/photos/ktee8/8332573428/sizes/l/in/photostream/

I excuted php artisan cms::setup command at /xampp/htdocs/pongocms/

Thank you for your time and have a great 2013!! :)

ktee55 commented 11 years ago

P.S. Here's the CMD command line message:

C:\xampp\htdocs\pongocms\php artisan cms::setup SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'

SQL: INSERT INTO pongo_files VALUES(1,'fabio_fumis.jpg','jpg', .......)

Bindings: array ( )

I failed a few times before that with this error message: SQLSTATE[HY000][2002] because of some database issues. Could it cause this error?

ktee55 commented 11 years ago

I tried it again from scratch and this time I've got this successful message:

Setup complete!

Visit frontend site: http://localhost/pongocms/public/ or login to http://localhost/pongocms/public//cms (admin/admin)

But the situation is the same. I'm still getting the same errors.

redbaron76 commented 11 years ago

OK, got it! But it's not a PongoCMS bug.

Take care your /application/config/application.php URL parameter doesn't contain trailing slash! It must be like this: 'url' => 'http://localhost/pongocms/public'

ktee55 commented 11 years ago

Great!! It fixed everything. And when I use virtual host like "http://pongocms.dev", just changing the URL parameter there and everything is fine!!

I do appreciate your help and kindness despite it's not your bug. I'm really looking forward to PongoCMS 2.0 and your upcoming works.

(I would have a good sleep tonight :)

redbaron76 commented 11 years ago

you're welcome!

phpbbireland commented 11 years ago

Just to say the install tutorial was first class and the fix helped too :+1: Now if I can work out why there appears to be no style/images ;)

phpbbireland commented 11 years ago

Found it... I had: 'url' => 'localhost/pongocms/public', should have been... 'url' => 'http://127.0.0.1/pongocms/public',

redbaron76 commented 11 years ago

Sure!

Il giorno 15/mar/2013, alle ore 16:03, phpbbireland notifications@github.com ha scritto:

Found it... I had: 'url' => 'localhost/pongocms/public', should have been... 'url' => 'http://127.0.0.1/pongocms/public',

— Reply to this email directly or view it on GitHub.