Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP is not working after updating to PHP 8.1 RC5

Tags:

php

php-8.1

After updating PHP 7.4 to PHP 8.1 RC5, PHP has stopped working on my machine and produces following error:

PHP Warning: PHP Startup: ^(text/|application/xhtml+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0

it produces the error even when I ask for php version:

PHP Warning:  PHP Startup: ^(text/|application/xhtml\+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0
PHP 8.1.0RC5 (cli) (built: Nov  4 2021 14:57:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.0RC5, Copyright (c), by Zend Technologies

OS: Ubuntu 20.04

updated using this repository:

sudo add-apt-repository ppa:ondrej/php

do you know what the problem could be?

like image 412
user335870 Avatar asked Nov 08 '21 16:11

user335870


2 Answers

Under debian (i think is same for ubuntu), I fixed by doing:

sudo apt-get install libpcre2-8-0
like image 176
Nathanaël Avatar answered Sep 29 '22 14:09

Nathanaël


Like @Douglas Roos said in comments,

sudo apt update
sudo apt upgrade

Will fix your problem.

like image 28
MushuLeDragon Avatar answered Sep 29 '22 14:09

MushuLeDragon