jordansamuel / PASTE

Paste is a project that started from the files pastebin.com used before it was bought.
https://phpaste.sourceforge.io/
GNU General Public License v3.0
295 stars 105 forks source link

Fatal error: Cannot redeclare str_contains() in G:\xampp\htdocs\paste\includes\functions.php on line 16 #170

Closed thecrankytech closed 3 years ago

thecrankytech commented 3 years ago

Fatal error: Cannot redeclare str_contains() in G:\xampp\htdocs\paste\includes\functions.php on line 16

Receiving this error after installing locally on a XAMPP server.

thinkverse commented 3 years ago

This is a known breaking change issue with PHP 8. PHP added its own str_contains function into its standard library in PHP 8, and since PASTE also adds the function, it throws an error because a function cannot be redeclared in PHP. A fix for this is included in the PR (#172) I just opened.

https://github.com/jordansamuel/PASTE/blob/8d16af0173f73e4fd84743100b9f012459fc503a/includes/functions.php#L16

thinkverse commented 3 years ago

A fix for this issue has been merged, you can clone the latest changes if you want to hotfix your version. I would not recommend that though since PHP 8 is not currently fully supported by PASTE, I would recommend downgrading your server to either 7.3 or 7.4 until it's fully supported. 👍