bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 165 forks source link

undefined offset: 1 on PHP #183

Open jpgorton opened 10 years ago

jpgorton commented 10 years ago

I asked this on stackoverflow too.. not sure if it's a bug, but thought I'd ask... http://stackoverflow.com/questions/24977011

I've been using genghis with great success on various servers to manage my mongo databases, but can't get it to work on my rackspace server (fedora 17, apache 2.2, php 5.4).

All I do to install is copy genghis.php into the folder with my other php files, which has worked no problems on several different servers. I've tried on this particular server with the last few genghis versions with no difference. Maybe I'm going crazy, but most likely I'm doing something wrong.

I'm getting this message...

Fatal error: Uncaught exception 'Genghis_ErrorException' with message 'PHP error: Undefined offset: 1' in /www/engine/system/genghis.php:17 Stack trace: #0 /www/engine/system/genghis.php(17): Genghis_ErrorException::throwException(8, 'Undefined offse...', '/www/engine/sys...', 17, Array) #1 /www/engine/system/genghis.php(17): Genghis_AssetLoader_Inline->initAssets() #2 /www/engine/system/genghis.php(15): Genghis_AssetLoader_Inline->loadRaw('error.html.must...') #3 /www/engine/system/genghis.php(15): Genghis_App->renderTemplate('error.html.must...', 500, Array) #4 /www/engine/system/genghis.php(15): Genghis_App->errorResponse('PHP error: Und...') #5 /www/engine/system/genghis.php(36): Genghis_App->run() #6 {main} thrown in /www/engine/system/genghis.php on line 17

bobthecow commented 10 years ago

My guess would be multibyte strings, but I'd have to dig in a bit more to know for sure.

Have you tried it with the dev branch version?

jpgorton commented 10 years ago

using dev branch version instead changes the error...

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unknown asset: 'error.mustache'' in /www/engine/system/genghis.php:30 Stack trace: #0 /www/engine/system/genghis.php(30): Genghis_AssetLoader_Inline->loadRaw('error.mustache') #1 /www/engine/system/genghis.php(15): Genghis_AssetLoader_Inline->loadTemplate('error.mustache') #2 /www/engine/system/genghis.php(15): Genghis_App->renderTemplate('error.mustache', 703, Array) #3 /www/engine/system/genghis.php(15): Genghis_App->errorResponse('Unknown asset: ...', 703) #4 /www/engine/system/genghis.php(36): Genghis_App->run() #5 {main} thrown in /www/engine/system/genghis.php on line 30

jpgorton commented 10 years ago

which PHP extensions need to be installed for genghis to work properly?

bobthecow commented 10 years ago

The only extension it requires is mongodb. This has to be a configuration issue, or a bug with a specific php version.

Do you mind pasting the output of php -i into a Gist?

jpgorton commented 10 years ago

Thanks for looking into this. https://gist.github.com/jpgorton/0ae7c9d4ad2bcee73afd Anything stand out as the culprit?

jpgorton commented 10 years ago

I've deleted the virtual server and installed a new one with fedora 20. It's working fine now (php version 5.5.14). I assume it was a bug with PHP, but I didn't have the time the figure it out.

bobthecow commented 10 years ago

@jpgorton I didn't see anything with your configuration from an initial glance, but I'm glad you got it resolved. I'll keep this issue open for a bit and try to dig into the cause just in case there's something I can do from the Genghis end.

Thanks for reporting your issue.

smeagol74 commented 10 years ago

Same issue here with Debian/jessie, still can not make it working. https://gist.github.com/smeagol74/f957172cde46bd02d58c Will be cool if you can suggest something.