ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP errors in Member area of control panel

January 31, 2012 1:52pm

Subscribe [3]
  • #1 / Jan 31, 2012 1:52pm

    roadRUNN3R

    26 posts

    I’m getting the following error in the “Members > View all” area of the EE control panel (v 2.3.1) when I attempt to click on a user to edit their settings:

    Fatal error: Call to undefined function ctype_digit() in system/expressionengine/controllers/cp/myaccount.php on line 189

    And I’m getting a (related?) series of PHP errors when I attempt to edit and save Member Group settings. Screenshot here: http://dl.dropbox.com/u/9501799/PHPerrors.png

    I’ve spoken at length with my server administrator and the server environment seems to be meeting all EE requirements. I also verified this by running the Server Wizard and found everything checked out.

    Any ideas what the problem could be?

  • #2 / Jan 31, 2012 2:32pm

    RevaCo

    240 posts

  • #3 / Jan 31, 2012 3:09pm

    roadRUNN3R

    26 posts

    Thanks johnnlefp. This could help. I contacted my server administrator to see if he can explicitly enable ctype functions in PHP. I’ll report back once we’ve given that a try.

    In the meantime, I’m still stumped as to why I’m getting PHP errors when trying to edit Member Group settings. Here’s the link to the screenshot again: http://dl.dropbox.com/u/9501799/PHPerrors.png

  • #4 / Jan 31, 2012 3:28pm

    roadRUNN3R

    26 posts

    Thanks johnnlefp!! Once my server administrator enabled ctype functions in php.ini I was able to get into user account settings without issue :D

    That solves the first problem, but not the second: editing user groups.

    Once more, I’m getting the following set of PHP errors when attempting to modify Member Group settings: http://dl.dropbox.com/u/9501799/PHPerrors.png

    Any help would be much appreciated!

  • #5 / Feb 01, 2012 2:57pm

    Kevin Smith

    4784 posts

    Hi roadRUNN3R,

    Hmm… sounds like your server admin’s running a fairly locked down server. The only time I’ve seen that second error is when someone is running a site with a high combination of MSM sites and member groups and their host was limiting the size of PHP arrays. Even if you’re not running a lot of MSM sites and member groups, it might be that the admin has set the size of PHP arrays prohibitively low. Could you check with the admin to see about that?

  • #6 / Feb 01, 2012 5:40pm

    roadRUNN3R

    26 posts

    Thanks for the response Kevin. Here’s the answer I got from my server admin:

    “There is no configuration value determining how large any particular variable may be in terms of size, except for the overall memory limit. The memory limit controls how much memory any single instance of a PHP script is allowed to consume at once. The default value for this is 8 MB, and that serves most purposes. The memory limit on the server in question is 64 MB. Now, I can increase that if you like, but I’m wondering if it’s really necessary, as that’s already 8 times the default value.”

    Sounds like the memory limit may not be the problem, right?

  • #7 / Feb 02, 2012 3:08pm

    roadRUNN3R

    26 posts

    Any other insights guys? I’m attaching another screenshot with a new set of errors I got today in a different section of the control panel: http://dl.dropbox.com/u/9501799/PHPerrors2.png

    The “Cannot modify header information” error keeps coming up… don’t know what that means.

    Does anyone get the sense that this is a problem with the server configuration, or could the problem be rooted in something else?

  • #8 / Feb 02, 2012 5:15pm

    roadRUNN3R

    26 posts

    I think I found a solution. I researched the “Cannot modify header information” error and found a suggestion to look for statements that could send user output before the header statement.

    So in the /system/core/Exceptions.php file I changed this:

    function show_php_error($severity, $message, $filepath, $line)
     {
      $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
    
      $filepath = str_replace("\\", "/", $filepath);
    
      // For safety reasons we do not show the full file path
      if (FALSE !== strpos($filepath, '/'))
      {
       $x = explode('/', $filepath);
       $filepath = $x[count($x)-2].'/'.end($x);
      }
    
      if (ob_get_level() > $this->ob_level + 1)
      {
       ob_end_flush();
      }
      ob_start();
      include(APPPATH.'errors/error_php.php');
      $buffer = ob_get_contents();
      ob_end_clean();
      echo $buffer;
     }

    to this:

    function show_php_error($severity, $message, $filepath, $line)
     {
      $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
    
      $filepath = str_replace("\\", "/", $filepath);
    
      // For safety reasons we do not show the full file path
      if (FALSE !== strpos($filepath, '/'))
      {
       $x = explode('/', $filepath);
       $filepath = $x[count($x)-2].'/'.end($x);
      }
    
      if (ob_get_level() > $this->ob_level + 1)
      {
       ob_end_flush();
      }
      ob_start();
      echo $buffer;
      include(APPPATH.'errors/error_php.php');
      $buffer = ob_get_contents();
      ob_end_clean();
     }

    (Note the higher placement of ‘echo $buffer;’ in the last block of code.)

    This has taken care of all the errors I was getting. I’m just wondering if that modification will result in any unwanted consequences down the road?

  • #9 / Feb 05, 2012 7:51am

    Sean C. Smith

    3818 posts

    roadRunner,

    I’m glad you’ve found a solution to this. However, since you are hacking the core files this could lead to complications in the future when upgrading the site. I would recommend keeping a note about this hack available so that you know about it in the future and can replicate if necessary.

    Sean

  • #10 / Feb 06, 2012 10:53am

    roadRUNN3R

    26 posts

    Thanks Sean. I’ve done that and will keep it in mind for future updates. It doesn’t quite sit right to have resorted to altering EE’s core files, but the solution does appear to have worked and I have to move forward on this project. I wonder what it is about the server that was causing problems with that block of code. Is there any way to find out?

  • #11 / Feb 08, 2012 4:36pm

    Shane Eckert

    7174 posts

    Hello roadRUNN3R,

    Going back to the error you mentioned. http://dl.dropbox.com/u/9501799/PHPerrors2.png

    That’s an error thrown by EEvent Helper. Can you try following this advice and tell me if that helps? If not, you might ask Derek, the developer, about the error using the Devot:ee support request.

    If you are comfortable to move forward as is, I understand, I wanted to give you the option of troubleshooting further and being able to undo the changes to the ExpressionEngine core files.

    I hope this helps. Please let me know if you have any problems or any more questions.

    Cheers,

  • #12 / Feb 09, 2012 4:38pm

    roadRUNN3R

    26 posts

    Hi Shane. Strangely, this error seemed to somehow clear itself out. After beginning to realize the implications of the code change I’d made (disabling the system from being able to report an error at that point, if I’m not mistaken), I changed it back but the error didn’t return. I’m sure there’s a reason why it didn’t reoccur, but it’s beyond me. I’m pretty positive I returned the code to its original state.

    I went ahead and followed the instructions on the EEvent Helper module page just in case though. So I think I’m taken care of for this issue. Thanks for all the help everyone!

  • #13 / Feb 09, 2012 4:39pm

    Shane Eckert

    7174 posts

    Hello roadRUNN3R,

    I am happy to hear it!

    Thank you for using the ExpressionEngine forums!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases