0

I'm trying to use PHP 8 with composer, but the PHP itself gives me an error. Here is the result when I run PHP -v on the terminal. My OS is macOS, and I used Homebrew to install PHP.

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

Warning: PHP Startup: ^(text/|application/xhtml\+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0
PHP 8.1.10 (cli) (built: Sep  1 2022 15:40:39) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies
  • those are startup warning/errors, have you tried running php script with the compiled binary? You might discover that running php scripts works normally even though there is startup warnings – Kristian Sep 02 '22 at 08:43
  • Does this answer your question? [PHP is not working after updating to PHP 8.1 RC5](https://stackoverflow.com/questions/69886619/php-is-not-working-after-updating-to-php-8-1-rc5) – Justinas Sep 02 '22 at 08:43
  • @Kristian, I'm trying to use composer, but it gives me an error coming from PHP. I ran `php -r 'echo "test\n";' ` and it still gives me warning. – Hossein hossein Sep 02 '22 at 08:46
  • you can just ignore the warning or discard it like `php -r 'echo "test\n";' 2>/dev/null ` – Kristian Sep 02 '22 at 08:49
  • What about the composer problem? I want to use composer and it doesn't work because of this PHP problem. – Hossein hossein Sep 02 '22 at 08:53
  • what problem occurs with composer? Maybe you can update your question to include what goes wrong with composer (e.g.: what error message is displayed when executing composer command) – Kristian Sep 02 '22 at 17:21

0 Answers0