php - Symfony Panther trying to start chrome on apache2 server production

one text

I am trying to use Symfony Panther framework on Ubuntu 22.04 LTS with PHP 8.1.2 and apache server, in my application i am trying to connect to a website and scrap the information from that website and that use some info on my application.

And it gives me this error when trying to create the google client to scrap the website Client::createChromeClient()

PHP Fatal error:  Uncaught RuntimeException: Could not start chrome. Exit code: 1 (General error). 
Error output: /system.slice/apache2.service is not a snap cgroup in /var/www/workspace/vendor/symfony/panther/src/ProcessManager/WebServerReadinessProbeTrait.php:53

Stack trace:
#0 /var/www/workspace/vendor/symfony/panther/src/ProcessManager/ChromeManager.php(53): Symfony\\Component\\Panther\\ProcessManager\\ChromeManager->waitUntilReady()
#1 /var/www/workspace/vendor/symfony/panther/src/Client.php(117): Symfony\\Component\\Panther\\ProcessManager\\ChromeManager->start()
#2 /var/www/workspace/vendor/symfony/panther/src/Client.php(521): Symfony\\Component\\Panther\\Client->start()
#3 /var/www/workspace/vendor/symfony/panther/src/Client.php(273): Symfony\\Component\\Panther\\Client->get()
#4 /var/www/workspace/php/stocks.php(27): Symfony\\Component\\Panther\\Client->request()
#5 {main}\n  thrown in /var/www/workspace/vendor/symfony/panther/src/ProcessManager/WebServerReadinessProbeTrait.php on line 53, referer: https://agnusworkspace.ddccompany.tech/workspace.php

In my local enviroment it works properly but on production enviroment it doesnt works.

Here is my code on php. How can i solve this problem, to start chrome properly?

<?php
require_once 'funcoes.php';
require_once 'stocks_html.php';

require __DIR__ . '/../vendor/autoload.php';

use \Symfony\Component\Panther\Client;

$ok = "0";
$erro = "1";

$chave = $_POST["chave"];

switch ($chave) {
case "get_stocks_by_ativo":
    $ativo = $_POST["ativo"];
    $client = Client::createChromeClient(); //COLOCAR FIREFOX

    $pega = $client->request('GET', 'https://teste.com/teste.php&ativo='.$ativo);

    $arr = [];

    $count_check = $pega->filter('html body.detalhes div.center div.conteudo.clearfix table.w728 tbody tr td.data.w35 span.txt')->count();

    if($count_check > 0) {
        $tipo_ativo = $pega->filterXPath('/html/body/div[1]/div[2]/table[1]/tbody/tr[1]/td[1]/span[2]')->text(); // = Papel / FII

        if($tipo_ativo == "Papel") {
            $arr["sigla"] = $pega->filter('html body.detalhes div.center div.conteudo.clearfix table.w728 tbody tr td.data.w35 span.txt')->text();
        }
     }
     break;
}
     

Source