# Plugin could not be activated because it triggered a fatal error

**URL:** https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922
**Category:** WordPress
**Created:** [November 15, 2016, 2:40pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922 "2016-11-15T14:40:35Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [November 15, 2016, 2:40pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/1 "2016-11-15T14:40:35Z")

</div>

Hi folks,  
I installed and used the plugin until some weeks ago when during an update it break my blog ☹  
Deactivated and de-installed it now I can’t install it anymore

 ![](https://global.discourse-cdn.com/meta/original/3X/2/c/2c4b90925821749b747a0726f15051e631b6f9f3.png)

public static function get\_options() {  
$options = ; \<---- line 23

```
            $discourse_option_groups = get_option( 'discourse_option_groups' );
            if ( $discourse_option_groups ) {

```

That’s my record on mysql, I just removed it but… nothing ☹

| 32290 | discourse | a:19:{s:3:“url”;s:31:“[http://community.nethserver.org](http://community.nethserver.org)”;s:7:“api-key”;s:64:“xxxxxx”;s:16:“publish-username”;s:12:“alefattorini”;s:16:“publish-category”;i:1;s:17:“full-post-content”;i:1;s:12:“auto-publish”;i:1;s:10:“auto-track”;i:1;s:18:“allowed\_post\_types”;a:1:{i:0;s:4:“post”;}s:22:“use-discourse-comments”;i:1;s:25:“existing-comments-heading”;s:0:“”;s:12:“max-comments”;s:1:“5”;s:11:“min-replies”;s:1:“1”;s:9:“min-score”;s:1:“0”;s:15:“min-trust-level”;s:1:“1”;s:24:“bypass-trust-level-score”;s:2:“50”;s:21:“custom-excerpt-length”;s:2:“55”;s:22:“custom-datetime-format”;s:0:“”;s:10:“login-path”;s:0:“”;s:10:“sso-secret”;s:0:“”;} | yes |

Any hint?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 15, 2016, 2:52pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/2 "2016-11-15T14:52:05Z")

</div>

I think it’s because you have an old version of php.

You can either update php or change that to the old syntax,which is something like

```
$options = array();

```

---

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [November 15, 2016, 3:25pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/3 "2016-11-15T15:25:52Z")

</div>

Thanks but I have another error at line 165 the last one ;-(

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 15, 2016, 3:46pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/4 "2016-11-15T15:46:21Z")

</div>

you can’t just delete the one,you have to declare the array. Think that there is another one somewhere too. I did it last week, and don’t remember exactly. I think I got it to work, but can’t quite remember. I will try to check when I get to the office.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 15, 2016, 4:37pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/5 "2016-11-15T16:37:11Z")

</div>

What PHP version do you have on your server? I can update the plugin to support php 5.3.

---

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [November 15, 2016, 5:23pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/6 "2016-11-15T17:23:01Z")

</div>

Sorry, standard CentOS 6 php-5.3.3

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 15, 2016, 5:33pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/7 "2016-11-15T17:33:24Z")

</div>

I think the only issue the plugin has with php 5.3 is that it’s creating an array with `[]`. That can be changed. I’ll update it later today or early tomorrow.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [November 15, 2016, 9:56pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/8 "2016-11-15T21:56:18Z")

</div>

Isn’t PHP 5.3 EOL? Might be wiser to have the user upgrade their PHP so they are still getting security patches.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 15, 2016, 10:01pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/9 "2016-11-15T22:01:07Z")

</div>

> [@simon](#):
>
> I think the only issue the plugin has with php 5.3 is that it’s creating an array with

I’m pretty sure that’s right, @simon. I had this problem last week and I think that I just changed two array declarations and that it worked after that. (OTOH, I’ve configured a whole bunch of stuff and it could be that there was something else wrong and I gave up.)

> [@cpradio](#):
>
> Might be wiser to have the user upgrade their PHP so they are still getting security patches.

That’s definitely true. In my case, I’m working on moving off of my old Ubuntu 12.04 server. I’m sure it’s going to happen any day now. 🙂

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 15, 2016, 10:06pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/10 "2016-11-15T22:06:26Z")

</div>

> [@cpradio](#):
>
> Isn’t PHP 5.3 EOL?

Yes it looks like it is: [PHP: Unsupported Branches](http://php.net/eol.php). I haven’t been testing against it. I can change the array declarations anyway.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 15, 2016, 10:10pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/11 "2016-11-15T22:10:31Z")

</div>

> [@simon](#):
>
> I haven’t been testing against it. I can change the array declarations anyway.

I was going to suggest that, but perhaps it’s better that only people who can fix that code such that it works with PHP5.3 be able to use it. 🙂

Or even just put a “VERSION X required” test somewhere.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 17, 2016, 5:18am UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/12 "2016-11-17T05:18:39Z")

</div>

I think the people who are saying that the plugin shouldn’t support PHP versions \< 5.4.0 are right. I’ve just updated the plugin and added a check for the PHP version to the plugin’s activation function. Attempts to activate the plugin with an unsupported PHP version will be halted.

I’ve also added a couple of notes to the plugin’s readme to say that it requires php \>=5.4.0.

@alefattorini if you are unable to update your PHP version and need a hand getting the plugin running on php-5.3.3, get in touch with me.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [November 17, 2016, 5:30am UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/13 "2016-11-17T05:30:02Z")

</div>

> [@cpradio](#):
>
> Isn’t PHP 5.3 EOL? Might be wiser to have the user upgrade their PHP so they are still getting security patches.

Assuming that the packages being used are those provided by the OS vendor, that version of PHP _will_ get security updates, based on backported patches of security vulnerabilities provided for later releases.

---

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [November 17, 2016, 1:28pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/14 "2016-11-17T13:28:00Z")

</div>

Thanks Simon, I appreciate it. Let me know how can I edit the plugin to adapt to my php version

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 17, 2016, 5:56pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/15 "2016-11-17T17:56:10Z")

</div>

Try this: [https://github.com/scossar/wp-discourse/tree/beta-php-5.3](https://github.com/scossar/wp-discourse/tree/beta-php-5.3)

It passes the php-5.3 codesniffer. You can click on the ‘Clone or download’ button on that page to download a zip file.

---

<div class="post-metadata">

### Author: ![benword](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benword/32/493782_2.png) [@benword](https://meta.discourse.org/u/benword)
#### Post date: [November 28, 2016, 4:43am UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/16 "2016-11-28T04:43:16Z")

</div>

> [@cpradio](#):
>
> Isn’t PHP 5.3 EOL? Might be wiser to have the user upgrade their PHP so they are still getting security patches.

This is the best solution. Even if it’s a simple change to allow support for PHP 5.3, it’s a really bad idea to encourage any usage of it whatsoever.

PHP 5.3 has been unsupported for over 2 years. PHP 5.5 is EOL. PHP 5.6 support ends in 1 month.

---

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [February 8, 2017, 2:20pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/17 "2017-02-08T14:20:07Z")

</div>

Sorry for the late response, it works like a charm 🙂  
Thanks so much, I owe you one!

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [February 26, 2017, 11:11pm UTC](https://meta.discourse.org/t/plugin-could-not-be-activated-because-it-triggered-a-fatal-error/52922/18 "2017-02-26T23:11:11Z")

</div>

> [@simon](#):
>
> Try this: [https://github.com/scossar/wp-discourse/tree/beta-php-5.3](https://github.com/scossar/wp-discourse/tree/beta-php-5.3)

Note: this repo was created to help people with existing wp-discourse setups that broke when updating from a previous version of the plugin. It won’t be receiving any updates!

If your WordPress installation is using a php version of less than 5.4, contact your hosting provider to see what can be done about upgrading the version.
