<p>As @mmikkel pointed out, as of <a href="http://buildwithcraft.com/updates#build2697" rel="nofollow">Craft 2.4.2697</a>, Craft is PHP 7 compatible.</p>

CC BY-SA 3.0
2015-10-15T19:55:27.183Z
[Craft 2.4.2697 is out, adding PHP 7 compatibility](http://buildwithcraft.com/updates#build2697).
Mats Mikkel Rummelhoff
CC BY-SA 4.0
2018-08-16T19:55:15.183Z
[Craft 2.7](https://craftcms.com/news/craft-2-7) also has PHP 7.2 support.
Frank Lämmer
CC BY-SA 3.0
2015-10-12T19:54:57.163Z
2015-10-15T21:06:22.373Z
2015-10-15T21:06:22.373Z
Brad Bell
<p>I'm attempting to run Craft (2.4.2696) on a server with PHP 7 RC, and I'm seeing <a href="http://cly.mmikkel.no/image/310E1X203U0Y" rel="nofollow">the following PHP warning</a>:</p>

<p><code>Declaration of Craft\DbCommand::addForeignKey($table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL)
</code></p>

<p>It's only a warning, and with <code>devMode</code> off, the site seems to function well. I'm not going to put anything that throws warnings into production, though.</p>

<p>My question(s): What is the cause for this warning, and is it something I can fix myself? Does Craft officially support PHP 7?</p>

CC BY-SA 3.0
2015-10-12T17:54:29.537Z
Looks like PHP 7 reclassified some error messages from E_STRICT to E_WARNING (including this one): https://wiki.php.net/rfc/reclassify_e_strict#signature_mismatch_during_inheritance Will update with an answer if I can think of a clean solution.
Brad Bell
CC BY-SA 3.0
2015-10-12T17:55:56.770Z
Sweet, thanks @BradBell. I can revert to 5.6 but it would be fun to play around with 7. Also interested in knowing whether Craft 2.x officially supports 7 or if its too early yet. The docs doesn't mention it at all.
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-10-12T18:02:21.973Z
FWIW Craft 3 doesn't have this issue, too.
Brad Bell
CC BY-SA 3.0
2015-10-12T18:03:14.937Z
Good to know ;)
Mats Mikkel Rummelhoff
<php><server>
Does Craft work with PHP 7?
# Does Craft work with PHP 7?

(Asked by: username_0 on 2015-10-12)

I'm attempting to run Craft (2.4.2696) on a server with PHP 7 RC, and I'm seeing [the following PHP warning](http://cly.mmikkel.no/image/310E1X203U0Y):

`Declaration of Craft\DbCommand::addForeignKey($table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL)`

It's only a warning, and with `devMode` off, the site seems to function well. I'm not going to put anything that throws warnings into production, though.

My question(s): What is the cause for this warning, and is it something I can fix myself? Does Craft officially support PHP 7?

**Tags:** php, server

> **Comments:**
> **username_1**: Looks like PHP 7 reclassified some error messages from E_STRICT to E_WARNING (including this one): https://wiki.php.net/rfc/reclassify_e_strict#signature_mismatch_during_inheritance Will update with an answer if I can think of a clean solution.  
> **username_0**: Sweet, thanks @BradBell. I can revert to 5.6 but it would be fun to play around with 7. Also interested in knowing whether Craft 2.x officially supports 7 or if its too early yet. The docs doesn't mention it at all.  
> **username_1**: FWIW Craft 3 doesn't have this issue, too.  
> **username_0**: Good to know ;)  

---

## 1 answers

### Answer by username_1 on 2015-10-12. Score: 4 | Accepted answer

As @mmikkel pointed out, as of [Craft 2.4.2697](http://buildwithcraft.com/updates#build2697), Craft is PHP 7 compatible.

> **Comments:**
> **username_0**: [Craft 2.4.2697 is out, adding PHP 7 compatibility](http://buildwithcraft.com/updates#build2697).  
> **username_2**: [Craft 2.7](https://craftcms.com/news/craft-2-7) also has PHP 7.2 support.  

---

