0

I've been using the WordPress "Elevate" Theme for one of my websites. Now I needed to move the whole website to a new server and I keep getting an Error 500 caused by the following error message:

mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected end of file in /var/www/vhosts/.../themes/elevate/functions.php on line 290

(290 is the very last line, I've removed some comments from the snippet.) The functions.php file is the very same as on the old server. The old one is running PHP 5.3.29, the new one runs 5.3.3. Switching over to any other version of PHP did not resolve the problem.

I've spent the whole day analyzing the code, I haven't found any problem with it yet - and what surprises me most is that it works without any troubles on the old machine.

I'd really appreciate if someone could point me towards a solution.

<?php
if ( ! function_exists( 'mythology_setup' ) ) :
function mythology_setup() {

        /* CONTENT WIDTH */
        if ( ! isset( $content_width ) )
        $content_width = 1120; /* pixels */

        /* THEME URL CONSTANT */
        if(!defined('WP_THEME_URL')) {
                define( 'WP_THEME_URL', get_template_directory_uri());
        }

        /* ---------------------------------------------------------*/
        /* INITIALIZE MYTHOLOGY CORE */

        /* OPTIONTREE LOADER */
        require get_template_directory() . '/mythology-core/mythology-optiontree-loader.php';

                load_template( trailingslashit( get_template_directory() ) . 'theme-core/ot-theme-options.php' ); // Load theme options.
                load_template( trailingslashit( get_template_directory() ) . 'theme-core/ot-meta-boxes.php' ); // Load Page/Post options.

        /* OPTIONTREE GOOGLE FONTS LOADER */
        // require get_template_directory() . '/mythology-core/mythology-otgooglefonts-loader.php';

        /* CORE PLUGINS */
        require get_template_directory() . '/mythology-core/mythology-plugin-loader.php';

        /* CORE FUNCTIONS */
        require get_template_directory() . '/mythology-core/mythology-core-functions.php';

        /* CORE STYLESHEETS */
        require get_template_directory() . '/mythology-core/mythology-register-stylesheets.php';

        /* CORE SCRIPTS */
        require get_template_directory() . '/mythology-core/mythology-register-scripts.php';

        /* CORE COMMENTS */
        require get_template_directory() . '/mythology-core/mythology-comments.php';

        /* CORE VT-RESIZE */
        $imgwidth = "750";
        $imgheight = "2000";
        $imagecrop = "true";
        require get_template_directory() . '/mythology-core/mythology-vt-resize.php';


        /* DEACTIVATE ANY CORE STYLESHEETS/SCRIPTS HERE */
        /*
        Stylesheet Example:
                wp_deregister_style('stylesheet-slug');
        Script Example:
                wp_deregister_script('script-slug');
        */

        /* ---------------------------------------------------------*/
        /* INITIALIZE THEME */
        /* ---------------------------------------------------------*/

        /* OPTION TREE */
        // require get_template_directory() . '/theme-core/theme-optiontree-loader.php';
        // NOW LOADED FROM CORE

        /* THEME LAYOUT VARIABLES */
        require get_template_directory() . '/theme-core/theme-layout-variables.php';

        /* THEME PLUGINS */
        require get_template_directory() . '/theme-core/theme-plugin-loader.php';

        /* THEME STYLESHEETS */
        require get_template_directory() . '/theme-core/theme-register-stylesheets.php';

        /* THEME SCRIPTS */
        require get_template_directory() . '/theme-core/theme-register-scripts.php';

        /* THEME MENUS */
        require get_template_directory() . '/theme-core/theme-register-menus.php';
        /* THEME SIDEBARS */
        require get_template_directory() . '/theme-core/theme-register-sidebars.php';

        function mythology_style_embed(){
                get_template_part( 'theme-core/ot', 'user-styles' );
                }
        add_action('wp_head', 'mythology_style_embed');

        /* DEREGISTER MQs */
        add_action('wp_enqueue_scripts', 'responsive_toggle');
        function responsive_toggle(){
                if(ot_get_option('responsive_toggle') == "off" ) :
                wp_deregister_style( 'theme-media-queries' );
                        wp_deregister_style( 'media-queries' );
                endif;
        }

        /* ---------------------------------------------------------*/
        /* THEME SUPPORT DECLARATIONS */
        /* ---------------------------------------------------------*/

        /* WOOCOMMERCE */
        /* add_theme_support( 'woocommerce' );
                remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
                remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);

                add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
                add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);

                function my_theme_wrapper_start() {
                  echo '<main id="main" class="site-main" role="main">';
                }

                function my_theme_wrapper_end() {
                  echo '</main>';
                } */

        /* Post Formats & Automatic feed links */
        add_theme_support( 'automatic-feed-links' );

        /* Post Thumbnail Support */
        add_theme_support( 'post-thumbnails' );
        set_post_thumbnail_size( 960, 450, true );
        add_image_size( 'slim', 1280, 300, true );

        /* Add shortcode support in widgets */
        add_filter('widget_text', 'do_shortcode');

        // Enable support for Post Formats.
        // add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );

        /**
         * Add theme support for Infinite Scroll.
         * See: http://jetpack.me/support/infinite-scroll/
         */
        /*
        add_theme_support( 'infinite-scroll', array(
                'container' => 'main',
                'footer'    => 'page',
        ) );
        */

        // Setup the WordPress core custom background feature.
        // add_theme_support( 'custom-background', apply_filters( 'mythology_custom_background_args', array(
        //      'default-image' => '',
        // ) ) );

        /* Remove some theme customizer default fields */
        function mythology_customize_register($wp_customize){
          $wp_customize->remove_section( 'colors');
          $wp_customize->remove_section( 'nav');
          $wp_customize->remove_section( 'static_front_page');
        }
        add_action( 'customize_register', 'mythology_customize_register' );


        // CUSTOM FOOTER FUNCTIONS & SCRIPTS
        function mythology_footer() { ?>


                <?php // START CUSTOM JQUERY OPTIONS
                // ADD IN SCRIPTS/RULES BASED ON USER SELECTED THEME & PAGE OPTIONS

                // Activate niceScroll (or not) based on user's preferences in the Theme Options.

                if (ot_get_option("niceScroll") == 'off') : ?>

                        <style type='text/css'>
                                html{overflow-y: auto !important;}
                                body{overflow:auto !important;}
                                .content_background{height: 9999% !important;}
                                #section-header{position: fixed;}
                                #section-content {margin-top: 7.3rem;}

                                #primary, #secondary {
                                    height: auto !important;
                                    overflow: hidden !important;
                                }
                        </style>

                <?php else : ?>

                        <script type='text/javascript'>
                        jQuery(document).ready(function($) {

                                /*-----------------------------------------------------------------------------------*/
                                /* niceScroll
                                /*-----------------------------------------------------------------------------------*/
                                $(".standard #main, #main-secondary").css("height", "100%");
                            $(".post-grid #main").css("height", "100%");

                            $(".standard #main, .standard #main-secondary").niceScroll({
                                cursorcolor:"rgba(155,155,155,0.2)",
                                cursoropacitymin:"0.2",
                                cursorfixedheight:"150",
                                hidecursordelay:"500",
                                cursordragontouch:"true",
                                horizrailenabled:"false"
                                });

                            $(".post-grid #main").niceScroll({
                                cursorcolor:"rgba(155,155,155,0.0)",
                                cursoropacitymin:"0.0",
                                cursorfixedheight:"150",
                                hidecursordelay:"500",
                                horizrailenabled:"false"
                                });

                        });
                        </script>

                <?php endif; ?>

                <?php // LIGHTBOX: IMAGES
                if(ot_get_option('lightbox_images') == "on" ) : ?>
                        <script type='text/javascript'>
                        jQuery(document).ready(function($) {
                                $('a[href*=".jpg"]').prettyPhoto();
                                $('a[href*=".png"]').prettyPhoto();
                                $('a[href*=".gif"]').prettyPhoto();
                        });
                        </script>
                <?php endif; ?>

                <?php // LIGHTBOX: VIDEOS
                if(ot_get_option('lightbox_videos') == "on" ) : ?>
                        <script type='text/javascript'>
                        jQuery(document).ready(function($) {
                                $('a[href*="vimeo"]').prettyPhoto();
                                $('a[href*="youtu"]').prettyPhoto();
                        });
                        </script>
                <?php endif; ?>


        <? }
        add_filter('wp_footer', 'mythology_footer');

}
endif; // mythology_setup
add_action( 'after_setup_theme', 'mythology_setup' );
user3205494
  • 297
  • 4
  • 10
  • You have missed a `;` or a `}` or an `end??` somewhere. – RiggsFolly Jan 25 '16 at 10:14
  • Well, I know that this is what the error message is about, but I can't find any of these things missing here... And, as I said, the funny thing is that the same file does not cause any errors on a different host. diff says it's the same file. – user3205494 Jan 25 '16 at 10:46
  • Additionally, phpcodechecker.com said "No issues found". – user3205494 Jan 25 '16 at 11:31

0 Answers0