Title: PHP 7 Error
Last modified: February 7, 2018

---

# PHP 7 Error

 *  Resolved [johnsd](https://wordpress.org/support/users/johnsd/)
 * (@johnsd)
 * [9 years ago](https://wordpress.org/support/topic/php-7-error-8/)
 * Hello,
 * We are getting the following error when running our site in PHP 7. Do you have
   any ideas what could be causing it?
 * Fatal error: Uncaught TypeError: Argument 1 passed to Ai1ec_Exception_Handler::
   handle_exception() must be an instance of Exception, instance of ParseError given
   in /srv/bindings/d89e28026ae44d28a3d4193c3a4a0afe/code/wp-content/plugins/all-
   in-one-event-calendar/lib/exception/handler.php:191 Stack trace: #0 [internal
   function]: Ai1ec_Exception_Handler->handle_exception(Object(ParseError)) #1 {
   main} thrown in /srv/bindings/d89e28026ae44d28a3d4193c3a4a0afe/code/wp-content/
   plugins/all-in-one-event-calendar/lib/exception/handler.php on line 191
 * Thanks!
    John

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [nluis3294](https://wordpress.org/support/users/nluis3294/)
 * (@nluis3294)
 * [9 years ago](https://wordpress.org/support/topic/php-7-error-8/#post-8891226)
 * Yes, I saw that exact error on the exact same line.
 * It’s that “Throwable” thing, and how php 7 handles errors and exceptions.
 * [https://wordpress.org/support/topic/exception-handle-php-7/](https://wordpress.org/support/topic/exception-handle-php-7/)
 * After reviewing my notes, I believe that the problem is that ai1ec is registering
   to handle all exceptions. That handle_exception() method handles all exceptions,
   even ones that are not coming fron ai1ec. The problem is, it generates that fatal
   error, so you can’t see what the error is coming from.
 * Cjhaas’ solution was to remove the “Exception” type hint.
 * I believe the way I got around this was to remove the type hint, to get rid of
   the fatal error. Then, var_dump the exception in line 192. Figure out where the
   error’s coming from. (My error came from outside ai1ec.) Fix that error, then
   change the the ai1ec code back.
 * I feel like this is something they should fix.
    -  This reply was modified 9 years ago by [nluis3294](https://wordpress.org/support/users/nluis3294/).
 *  [Sunny Lal](https://wordpress.org/support/users/sunny454/)
 * (@sunny454)
 * [9 years ago](https://wordpress.org/support/topic/php-7-error-8/#post-8900569)
 * Please refer to this article for the solution:
 * [https://wordpress.org/support/topic/exception-handle-php-7/](https://wordpress.org/support/topic/exception-handle-php-7/)
 * _[ Moderator note: [Signature redacted.](https://make.wordpress.org/support/handbook/forum-welcome/#avoid-signatures)]_
    -  This reply was modified 8 years, 11 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
 *  Thread Starter [johnsd](https://wordpress.org/support/users/johnsd/)
 * (@johnsd)
 * [9 years ago](https://wordpress.org/support/topic/php-7-error-8/#post-8922319)
 * Thank you, Sunny!
 *  [Milla](https://wordpress.org/support/users/mekaselska/)
 * (@mekaselska)
 * [9 years ago](https://wordpress.org/support/topic/php-7-error-8/#post-8943815)
 * Hi, is there going to be a fix from plugin side? My Theme options page went blank
   and when I enabled debugging, I saw
 * Fatal error: Uncaught TypeError: Argument 1 passed to Ai1ec_Exception_Handler::
   handle_exception() must be an instance of Exception, instance of Error given 
   in /data/wordpress/htdocs/wp-content/plugins/all-in-one-event-calendar/lib/exception/
   handler.php:191
 * on the Theme options page. If I understood the above correctly, the error might
   be anything but now the calendar is handling it.
 *  [Sunny Lal](https://wordpress.org/support/users/sunny454/)
 * (@sunny454)
 * [9 years ago](https://wordpress.org/support/topic/php-7-error-8/#post-8962168)
 * Hi [@mekaselska](https://wordpress.org/support/users/mekaselska/),
 * Yes, there is. In fact there is a new release scheduled for today (March 17, 
   2017).
 * Please follow these instructions to do a manual upgrade:
 * – Backup your current events by scrolling down to the bottom of your calendar
   and click on the [Subscribe] button, then click on “Add to Timely Calendar” and
   download the events file (download.ics).
    – Delete the file uninstall.php from
   the plugin directory that is currently on the server (found under /wp-content/
   plugins/all-in-one-event-calendar). Deleting this file ensures that when you 
   uninstall the current version of the plugin, your event data and calendar settings
   will be preserved when you delete the plugin (don’t skip this step – it’s important!)–
   Deactivate the All-in-One Event Calendar using your WordPress Dashboard. – Delete
   the All-in-One Event Calendar using your WordPress Dashboard. – Database -> wp_options,
   click option_name to sort and delete everything with ai1ec_, this will delete
   plugin settings but events will remain in the database. – Now install the latest
   version.
 * For faster assistance, please log into your Timely account and open a ticket 
   by clicking on the Get Help link, or click here: [https://dashboard.time.ly/account/get-help](https://dashboard.time.ly/account/get-help).
 * _[ Moderator note: [Signature redacted.](https://make.wordpress.org/support/handbook/forum-welcome/#avoid-signatures)]_
    -  This reply was modified 8 years, 11 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
 *  [iamXnl](https://wordpress.org/support/users/iamxnl/)
 * (@iamxnl)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php-7-error-8/#post-9407441)
 * [@sunny454](https://wordpress.org/support/users/sunny454/); I still revieve the
   following error:
 * Fatal error: Uncaught TypeError: Argument 1 passed to Ai1ec_Exception_Handler::
   handle_exception() must be an instance of Exception, instance of Error given 
   in /<ROOTPATH>/public_html/wp-content/plugins/all-in-one-event-calendar/lib/exception/
   handler.php:198 Stack trace: #0 [internal function]: Ai1ec_Exception_Handler-
   >handle_exception(Object(Error)) #1 {main} thrown in /<ROOT PATH>/public_html/
   wp-content/plugins/all-in-one-event-calendar/lib/exception/handler.php on line
   197
 * Code in handler.php line 197-ish:
 *     ```
       	public function handle_exception( Exception $exception ) {
       		if ( defined( 'AI1EC_DEBUG' ) && true === AI1EC_DEBUG ) {
       		echo '<pre>';
       			$this->var_debug( $exception );
       			echo '</pre>';
       			die();
       		}
       ```
   
 * tried changing to:
 *     ```
          public function handle_exception( $exception ) {
           if( $exception instanceof \Error ) {
               throw new \Exception( 'Exception re-throw', 0, $exception );
           }
           if ( defined( 'AI1EC_DEBUG' ) && true === AI1EC_DEBUG ) {
       ```
   
 * as per [http://cjhaas.com/blog/2017/02/24/one-event-calendar-time-ly-exceptionerror-problem/](http://cjhaas.com/blog/2017/02/24/one-event-calendar-time-ly-exceptionerror-problem/)
 * Is this solution still the way to solve this issue or is there anything else 
   I should do (since post is couple of months old and you mentioned a new release)
 * I’m using Ai1ec version 2.5.22
 * Many thanks in advance!
    -  This reply was modified 8 years, 7 months ago by [iamXnl](https://wordpress.org/support/users/iamxnl/).
      Reason: changed addressee (@sunny454) to correct user
 *  [Sunny Lal](https://wordpress.org/support/users/sunny454/)
 * (@sunny454)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php-7-error-8/#post-9470525)
 * Hi [@iamxnl](https://wordpress.org/support/users/iamxnl/)
 * You can try having your host revert back to PHP versin 5.6 which is apparently
   more stable and causes a lot fewer problems.
 *  [sflwa](https://wordpress.org/support/users/sflwa/)
 * (@sflwa)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/php-7-error-8/#post-9707823)
 * I would like to bump this as I’m having this issue too – I tried the update suggested
   on line 191 however that then caused a new error. I’m running PHP 7.1 and to 
   suggest downgrading to 5.6
 * 1) WordPress.org recommends PHP 7 or greater
    2) PHP 5.6 was EOL active Support
   back in January and 7.0 is in another week 3) This started when using Ad Rotate
   and trying to save a banner, however, as per displaying errors, the error is 
   coming from AI1EC
 * Thank you for your help
 *  [Sunny Lal](https://wordpress.org/support/users/sunny454/)
 * (@sunny454)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/php-7-error-8/#post-9707902)
 * Hi [@sflwa](https://wordpress.org/support/users/sflwa/),
 * This error is most likely a result of a plugin or theme conflict (usually caused
   by a caching or security plugin).. Please try a different theme temporarily such
   as Twenty Seventeen, or, disable all plugins and then check if the problem recurrs—
   then re-enable each one until you find which one caused the problem.
 * If you are still experiencing problems, please log into your Timely account and
   open a ticket by clicking on the Get Help link, or click here: [https://dashboard.time.ly/account/get-help](https://dashboard.time.ly/account/get-help).

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP 7 Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/all-in-one-event-calendar.svg)
 * [Timely All-in-One Events Calendar](https://wordpress.org/plugins/all-in-one-event-calendar/)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-event-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-event-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-event-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-event-calendar/reviews/)

 * 9 replies
 * 6 participants
 * Last reply from: [Sunny Lal](https://wordpress.org/support/users/sunny454/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/php-7-error-8/#post-9707902)
 * Status: resolved