WordPress.org

Support

Support » Miscellaneous » Fatal error: Call to undefined function: scandir()

Fatal error: Call to undefined function: scandir()

  • Devin Price
    Member

    @downstairsdev

    Does anyone know why I would be getting this message?

    Fatal error: Call to undefined function: scandir()

    Code looks like this, and is working on other servers. I am using PHP5.

    // Fetch alternate theme stylesheets
    $alt_stylesheet_dir = CHILDTHEME_THEME_DIRECTORY . 'styles/';
    $alt_stylesheets = array();
    
    if (is_dir($alt_stylesheet_dir)) {
      $styles = scandir($alt_stylesheet_dir);
      foreach ($styles as $style) {
        if (strpos($style, '.css')) {
          $alt_stylesheets[] = $style;
        }
      }
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error: Call to undefined function: scandir()’ is closed to new replies.