Questions tagged [php-8.1]

For questions specific to the usage and new features of PHP 8.1. Also, include the more generic [php] tag when using this tag.

PHP 8.1 (released November 2021) includes many new features including:

A full list of changes can be found in the migration guide.

336 questions
2
votes
1 answer

Nesting Groups of Filters not working in CodeIgniter 4

I'm having hard time to configure nested groups in CI 4. I'm trying to configure the access to routes passing thru a group of filters to authenticate and validate the data that i'm using in the controller. Here's a example of the…
2
votes
1 answer

Cypress/percy authorization failed

I have one question to cypress/percy. I use Cypress package version: 12.5.1, Percy:@percy/cli 1.20.0, php version PHP 8.1.16 (cli). I have one project with authentication and have to do snapshots with Percy. I have tried to use username and password…
Svetlana
  • 141
  • 5
2
votes
1 answer

Install XML-RPC in PHP8 Dockerfile

I have this Dockerfile: FROM php:8.1.0-fpm RUN apt-get update \ && apt-get install -y zlib1g-dev g++ git libicu-dev zip libzip-dev zip libpng-dev libssl-dev libxslt-dev wkhtmltopdf procps acl \ && pecl install apcu \ &&…
Aislinn
  • 73
  • 6
2
votes
1 answer

Deprecation notices in every console command following Symfony 5.4 upgrade

I am quite confused by the following deprecation notice in my Symfony 5.4 application. The "Symfony\Component\Console\Command\Command::$defaultName" property is considered final. You should not override it…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
2
votes
1 answer

Failed to read session data after updating php 7.1 to 8.1

Warning: session_start(): Failed to read session data: user (path: /tmp) Warning: session_start(): Failed to read session data: user (path: /tmp) After lots of Googling and cursing found out The above error can be thrown on various reasons: Folder…
2
votes
1 answer

Why I have "Not found" /admin in symfony easyAdminBundle 4 (php)

I can't open /admin page after installing easyAdminBundle in symfony app. I do: symfony composer req "admin:^4" then symfony console make:admin:dashboard This line generate this code.
Klipe_LD
  • 31
  • 3
2
votes
2 answers

php output buffer not working after php 7.4 to php 8.1 upgrade

The below code is not printing anything in the browser. actually, It should show the header menu. if I remove ob_start(); and ob_end_clean() at least its printing menu without CSS. // Turn on output buffering HTML ob_start(); echo preg_replace(…
sivakumar
  • 49
  • 1
  • 1
  • 13
2
votes
2 answers

Install/enable sqlsrv & pdo_sqlsrv drivers for php8.1 on ubuntu20.0

I am trying to enable sqlsrv drivers for php8.1 on Ubuntu 20.0. It is not showing the extension in phpinfo(). When trying to check the sqlsrv module with commmand php -m, the output is like this: I have followed official documentation…
Hemant Kumar
  • 1,025
  • 15
  • 32
2
votes
1 answer

Symfony 6.1 reset-password php 8.1

I am trying to install the Reset Password Feature on my symfony application. The Problem is that Composer tell me that : Your requirements could not be resolved to an installable set of packages. Problem 1 - php is present at…
cretthie
  • 349
  • 1
  • 2
  • 11
2
votes
0 answers

Why does this file_get_contents cause 400 bad request?

A URL should be properly encoded to deal with spaces when passed to file_get_contents, but there appears to be a strange inconsistency in behaviour (accidentally discovered) when not doing so that I'm curious about. Here we see a 400 bad request…
jamieburchell
  • 761
  • 1
  • 5
  • 18
2
votes
1 answer

/\s+$/u performs really bad if string contains many spaces in the middle

Consider this string (notice the horizontal scroll - the string is long): $content = 'Xxxxxx xx xxxx xxxxxx/xxxx xxxxxxx xx xxxxx xx xxx XXXXXXX/XXXXX XXXX XXXXXXX XXXX XXXXXX …
Nuno
  • 3,082
  • 5
  • 38
  • 58
2
votes
1 answer

Multiple Entity Managers with Test ENV

I am working with multiple Entity Managers and Connections in both DEV and PROD environements without any problem. In TEST environement I tried to add another connection inside doctrine.yaml file like this: But only the database related to default…
Khribi Wessim
  • 287
  • 2
  • 12
2
votes
1 answer

Variable key on php enum

Is it possible to access enumerations properties dynamically? Here is what I tried and the error I got. Access to undeclared static property ExampleEnum::$id enum ExampleEnum { case _1; case _2; public function getIt(): string { …
medilies
  • 1,811
  • 1
  • 8
  • 32
2
votes
2 answers

Symfony PHPUnit : Failed to start session because header have already been sent

Versions : PHP : 8.1 PHPUnit : 9.5.21 Symfony 6.1 When the following test is run by PhpUnit, I get an error about the session not being able to be started. Does anyone have an idea of the problem and how to solve it? The following topics do not…
Loicyeu
  • 115
  • 9
2
votes
1 answer

Why doctrine migrations ignore my index declaration?

I would like to create a table with an indexed columned to speed up searches. Here is a sample: #[ORM\Entity(repositoryClass: SettingRepository::class)] #[ORM\Table(name: '`tr_setting`', indexes: [ new ORM\Index(columns: ['code'], name:…