Skip to main content
Topic: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1) (Read 4886 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Configuration > Features & Options > Layout

When I click Layout, it crashes. Hmm...
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #1

Linux?
Windows?
PHP version?
Some "special" setting?

The only potentially peculiar thing that the page does is scan a few directories for controllers, so it's either a problem with win VS lin file structure or some php extension not working the way it is supposed to. I guess.
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #2

Linux. PHP 5.6 (tried on 5.4 as well, crashes too).

Not sure what you mean by "Special Setting" though.. :/

Edit: Woops, I thought you were asking for my own computer's OS. Updated to "Linux" instead. :p
Last Edit: June 17, 2016, 05:56:59 am by niloc
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #3

 emanuele has to fire up wamp on the laptop... :'( <= it takes ages on the poor thing!! :'( :'(
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #4

T.T Sorry, it's Linux, not Windows.
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #5

Heck.
I hoped it was windows because at least it gave me something to work on...

Could you check the permissions are all set correctly? (Maybe you have some file around in the controllers or addons directories that has a wrong permission/owner?)
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #6

All the files in Controllers & Addons are 644. Is that correct?
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #7

Ok, let's try to pinpoint the issue.
Could you open sources/admin/ManageFeatures.controller.php search for the line:
Code: [Select]
$config_vars = getFrontPageControllers();
and change it to:
Code: [Select]
$config_vars = array();
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #8

Wow it worked! :D :D :D

Nice job!
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #9

No, that's not a fix, it's just to confirm where the issue is.
Now, restore that line the way it was.
Open sources/subs/ManageFeatures.subs.php, close to the end there is this block:
Code: [Select]
	$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob);

$glob = new GlobIterator(ADDONSDIR . '/*/controllers/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob, '\\ElkArte\\Addon\\');
Try commenting it out and see if you can reach the page.
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #10

Code: [Select]
//	$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
// $classes += scanFileSystemForControllers($glob);

// $glob = new GlobIterator(ADDONSDIR . '/*/controllers/*.controller.php', FilesystemIterator::SKIP_DOTS);
// $classes += scanFileSystemForControllers($glob, '\\ElkArte\\Addon\\');

Alright done! It works once it's commented out.

So yeah good luck in your next step...  8)
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #11

Restore the commented code and comment out only the first pair of lines:
Code: [Select]
	$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob);
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #12

Yup it still works.
Facta, non verba.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #13

Now, just to double check: restore the two commented lines and comment out the other two.

Just to reduce confusion (because I'm not sure myself what I wrote LOL), the final code should look like:
Code: [Select]
	$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob);

// $glob = new GlobIterator(ADDONSDIR . '/*/controllers/*.controller.php', FilesystemIterator::SKIP_DOTS);
// $classes += scanFileSystemForControllers($glob, '\\ElkArte\\Addon\\');
Bugs creator.
Features destroyer.
Template killer.

Re: HTTP ERROR 500 when clicking "Layout" in Admin area (1.1)

Reply #14

Oh jeez.. it crashed. Error 500. :p

So yup those two lines are the culprit :@
Facta, non verba.