title: How to Fix Wordpress 500 Internal server error due to custom post type
body: <p>I am using couponXL theme for my site. Everything is working correct but except one ie., custom post type. In the theme , there is a plugin called CouponXL custom post type. This plugin is included to enable custom post type feature for the theme.</p>
  
  <p>Whenever I activate this plugin, server is responding with 500 internal server error. When I deactivate the plugin, server is running with no issue. So the issue must be with the custom post type.</p>
  
  <p>When I looked into the server error logs. I found the following error,</p>
  
  <pre><code>] [notice] EACCELERATOR(810915): PHP crashed on opline 28 of array_merge() at /home/teachpkc/public_html/offers/wp-includes/functions.php:3076
  ] [notice] EACCELERATOR(803175): PHP crashed on opline 28 of array_merge() at /home/teachpkc/public_html/offers/wp-includes/functions.php:3076
  </code></pre>
  
  <p>Here is the plugin code for the custom post type</p>
  
  <pre><code>&lt;?php
  /*
  Plugin Name: Coupon XL Custom Post Types
  Plugin URI: http://demo.powerthemes.club/themes/couponxl/
  Description: Coupon XL custom post types and taxonomies
  Version: 1.0
  Author: pebas
  Author URI: http://themeforest.net/user/pebas/
  License: GNU General Public License version 3.0
  */
  
  if( !function_exists( 'couponxl_post_types_and_taxonomies' ) ){
      function couponxl_post_types_and_taxonomies(){
          $offer_args = array(
              'labels' =&gt; array(
                  'name' =&gt; __( 'Offers', 'couponxl' ),
                  'singular_name' =&gt; __( 'Offer', 'couponxl' )
              ),
              'public' =&gt; true,
              'menu_icon' =&gt; 'dashicons-megaphone',
              'has_archive' =&gt; false,
              'supports' =&gt; array(
                  'title',
                  'editor',
                  'thumbnail',
                  'author',
                  'excerpt',
                  'comments'
              )
          );
          if( class_exists('ReduxFramework') &amp;&amp; function_exists('couponxl_get_option') ){
              $trans_offer = couponxl_get_option( 'trans_offer' );
              if( !empty( $trans_offer ) ){
                  $offer_args['rewrite'] = array( 'slug' =&gt; $trans_offer );
              }
          }
          register_post_type( 'offer', $offer_args ); 
  
          register_taxonomy( 'location', array( 'offer' ), array(
              'label' =&gt; __( 'Location', 'couponxl' ),
              'hierarchical' =&gt; true,
              'labels' =&gt; array(
                  'name'                          =&gt; __( 'Location', 'couponxl' ),
                  'singular_name'                 =&gt; __( 'Location', 'couponxl' ),
                  'menu_name'                     =&gt; __( 'Location', 'couponxl' ),
                  'all_items'                     =&gt; __( 'All Locations', 'couponxl' ),
                  'edit_item'                     =&gt; __( 'Edit Location', 'couponxl' ),
                  'view_item'                     =&gt; __( 'View Location', 'couponxl' ),
                  'update_item'                   =&gt; __( 'Update Location', 'couponxl' ),
                  'add_new_item'                  =&gt; __( 'Add New Location', 'couponxl' ),
                  'new_item_name'                 =&gt; __( 'New Location Name', 'couponxl' ),
                  'parent_item'                   =&gt; __( 'Parent Location', 'couponxl' ),
                  'parent_item_colon'             =&gt; __( 'Parent Location:', 'couponxl' ),
                  'search_items'                  =&gt; __( 'Search Locations', 'couponxl' ),
                  'popular_items'                 =&gt; __( 'Popular Locations', 'couponxl' ),
                  'separate_items_with_commas'    =&gt; __( 'Separate locations with commas', 'couponxl' ),
                  'add_or_remove_items'           =&gt; __( 'Add or remove locations', 'couponxl' ),
                  'choose_from_most_used'         =&gt; __( 'Choose from the most used locations', 'couponxl' ),
                  'not_found'                     =&gt; __( 'No locations found', 'couponxl' ),
              )
  
          ) );
  
  
          register_taxonomy( 'offer_cat', array( 'offer' ), array(
              'label' =&gt; __( 'Offer Categories', 'couponxl' ),
              'hierarchical' =&gt; true,
              'labels' =&gt; array(
                  'name'                          =&gt; __( 'Offer Categories', 'couponxl' ),
                  'singular_name'                 =&gt; __( 'Offer Category', 'couponxl' ),
                  'menu_name'                     =&gt; __( 'Offer Category', 'couponxl' ),
                  'all_items'                     =&gt; __( 'All Offer Categories', 'couponxl' ),
                  'edit_item'                     =&gt; __( 'Edit Offer Category', 'couponxl' ),
                  'view_item'                     =&gt; __( 'View Offer Category', 'couponxl' ),
                  'update_item'                   =&gt; __( 'Update Offer Category', 'couponxl' ),
                  'add_new_item'                  =&gt; __( 'Add New Offer Category', 'couponxl' ),
                  'new_item_name'                 =&gt; __( 'New Offer Category Name', 'couponxl' ),
                  'parent_item'                   =&gt; __( 'Parent Offer Category', 'couponxl' ),
                  'parent_item_colon'             =&gt; __( 'Parent Offer Category:', 'couponxl' ),
                  'search_items'                  =&gt; __( 'Search Offer Categories', 'couponxl' ),
                  'popular_items'                 =&gt; __( 'Popular Offer Categories', 'couponxl' ),
                  'separate_items_with_commas'    =&gt; __( 'Separate offer categories with commas', 'couponxl' ),
                  'add_or_remove_items'           =&gt; __( 'Add or remove offer categories', 'couponxl' ),
                  'choose_from_most_used'         =&gt; __( 'Choose from the most used offer categories', 'couponxl' ),
                  'not_found'                     =&gt; __( 'No offer categories found', 'couponxl' ),
              )
  
          ) );
  
          register_taxonomy( 'offer_tag', array( 'offer' ), array(
              'label' =&gt; __( 'Offer Tags', 'couponxl' ),
              'hierarchical' =&gt; false,
              'labels' =&gt; array(
                  'name'                          =&gt; __( 'Offer Tags', 'couponxl' ),
                  'singular_name'                 =&gt; __( 'Offer Tag', 'couponxl' ),
                  'menu_name'                     =&gt; __( 'Offer Tag', 'couponxl' ),
                  'all_items'                     =&gt; __( 'All Offer Tags', 'couponxl' ),
                  'edit_item'                     =&gt; __( 'Edit Offer Tag', 'couponxl' ),
                  'view_item'                     =&gt; __( 'View Offer Tag', 'couponxl' ),
                  'update_item'                   =&gt; __( 'Update Offer Tag', 'couponxl' ),
                  'add_new_item'                  =&gt; __( 'Add New Offer Tag', 'couponxl' ),
                  'new_item_name'                 =&gt; __( 'New Offer Tag Name', 'couponxl' ),
                  'parent_item'                   =&gt; __( 'Parent Offer Tag', 'couponxl' ),
                  'parent_item_colon'             =&gt; __( 'Parent Offer Tag:', 'couponxl' ),
                  'search_items'                  =&gt; __( 'Search Offer Tags', 'couponxl' ),
                  'popular_items'                 =&gt; __( 'Popular Offer Tags', 'couponxl' ),
                  'separate_items_with_commas'    =&gt; __( 'Separate offer tags with commas', 'couponxl' ),
                  'add_or_remove_items'           =&gt; __( 'Add or remove offer tags', 'couponxl' ),
                  'choose_from_most_used'         =&gt; __( 'Choose from the most used offer tags', 'couponxl' ),
                  'not_found'                     =&gt; __( 'No offer tags found', 'couponxl' ),
              )
  
          ) );
  
          $store_args = array(
              'labels' =&gt; array(
                  'name' =&gt; __( 'Stores', 'couponxl' ),
                  'singular_name' =&gt; __( 'Store', 'couponxl' )
              ),
              'public' =&gt; true,
              'menu_icon' =&gt; 'dashicons-store',
              'has_archive' =&gt; false,
              'supports' =&gt; array(
                  'title',
                  'editor',
                  'thumbnail'
              ),
          );
          if( class_exists('ReduxFramework') &amp;&amp; function_exists('couponxl_get_option') ){
              $trans_store = couponxl_get_option( 'trans_store' );
              if( !empty( $trans_store ) ){
                  $store_args['rewrite'] = array( 'slug' =&gt; $trans_store );
              }
          }
          register_post_type( 'store', $store_args ); 
  
          register_taxonomy( 'letter', array( 'store' ), array(
              'label' =&gt; __( 'Letters', 'couponxl' ),
              'hierarchical' =&gt; true,
              'labels' =&gt; array(
                  'name'                          =&gt; __( 'Letters', 'couponxl' ),
                  'singular_name'                 =&gt; __( 'Letter', 'couponxl' ),
                  'menu_name'                     =&gt; __( 'Letter', 'couponxl' ),
                  'all_items'                     =&gt; __( 'All Letters', 'couponxl' ),
                  'edit_item'                     =&gt; __( 'Edit Letter', 'couponxl' ),
                  'view_item'                     =&gt; __( 'View Letter', 'couponxl' ),
                  'update_item'                   =&gt; __( 'Update Letter', 'couponxl' ),
                  'add_new_item'                  =&gt; __( 'Add New Letter', 'couponxl' ),
                  'new_item_name'                 =&gt; __( 'New Letter Name', 'couponxl' ),
                  'parent_item'                   =&gt; __( 'Parent Letter', 'couponxl' ),
                  'parent_item_colon'             =&gt; __( 'Parent Letter:', 'couponxl' ),
                  'search_items'                  =&gt; __( 'Search Letters', 'couponxl' ),
                  'popular_items'                 =&gt; __( 'Popular Letters', 'couponxl' ),
                  'separate_items_with_commas'    =&gt; __( 'Separate letters with commas', 'couponxl' ),
                  'add_or_remove_items'           =&gt; __( 'Add or remove letters', 'couponxl' ),
                  'choose_from_most_used'         =&gt; __( 'Choose from the most used letters', 'couponxl' ),
                  'not_found'                     =&gt; __( 'No letters found', 'couponxl' ),
              )
  
          ) );        
  
          register_post_type( 'voucher', array(
              'labels' =&gt; array(
                  'name' =&gt; __( 'Vouchers', 'couponxl' ),
                  'singular_name' =&gt; __( 'Voucher', 'couponxl' )
              ),
              'public' =&gt; true,
              'menu_icon' =&gt; 'dashicons-tickets-alt',
              'has_archive' =&gt; false,
              'supports' =&gt; array(
                  'title',
              ),
              'capabilities' =&gt; array(
                  'publish_posts' =&gt; 'manage_options',
                  'edit_posts' =&gt; 'manage_options',
                  'edit_others_posts' =&gt; 'manage_options',
                  'delete_posts' =&gt; 'manage_options',
                  'delete_others_posts' =&gt; 'manage_options',
                  'read_private_posts' =&gt; 'manage_options',
                  'edit_post' =&gt; 'manage_options',
                  'delete_post' =&gt; 'manage_options',
                  'read_post' =&gt; 'manage_options',
              ),          
          ));
  
          if( class_exists( 'Seravo_Custom_Bulk_Action' ) ){
              $bulk_actions = new Seravo_Custom_Bulk_Action( array('post_type' =&gt; 'voucher') );
  
              $bulk_actions-&gt;register_bulk_action(array(
                  'menu_text' =&gt; __( 'Pay To Sellers', 'couponxl' ),
                  'admin_notice'=&gt; __( 'Sellers are paid', 'couponxl' ),
                  'callback' =&gt; function( $post_ids ) {
                      couponxl_pay_all_sellers( $post_ids, 'no' );
                      return true;
                  }
              ));
  
              $bulk_actions-&gt;init();
          }
  
      }
  }
  add_action('init', 'couponxl_post_types_and_taxonomies', 0);
  
  ?&gt;
  </code></pre>
  
  <p>I have tried all solutions in the net but couldn't solve :( Could you please help me, what is the error and how to fix it :) </p>
  
  <p><strong>Note:</strong> I am using this theme in a sub-domain. Don't know whether the problem could be because of this. To your information guys I've added</p>