php why the session destroyed before the expiration time?

For security reasons I deleted all cookies from my code and replaced them with sessions.
Why doesn’t the system maintain the user session and login?
the user is logged out prematurely
I modified the php.ini with the value
session.gc_maxlifetime = 86400 //1 day
and added to my php code the same value
ini_set(‘session.gc_maxlifetime’,86400);

I’m confused.
I think the problem is closing the browser or PC before the expiration time. confirmed?
How could I avoid it?

this is my code
login.php (after ajax)

session_start();
include("../config.php");

$_SESSION['iax']=$id_az;
$_SESSION['nome_utx']=$nome;

and on all pages
config.php

ob_start();
if (!isset($_SESSION)) {
//Imposta la durata del cookie della sessione
ini_set('session.cookie_lifetime', 86400);//echo ini_get('session.cookie_lifetime')
//Imposta la durata massima della sessione
ini_set('session.gc_maxlifetime', 86400);
//echo "time: ".ini_get("session.gc_maxlifetime");
# Enable session garbage collection with a 1% chance of
# running on each session_start()
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
session_start();
}

.....
CODE
....

How To Make A Tracking Tool in PHP? [closed]

I’m getting started with PHP and I want to make a tool that will let users track their deliveries such like tracking E-ID like say if they want to track the order of their cards. So, where should I get started and what things I should keep in mind before I actually dive into it?

Tried youtube lectures but I’m lacking the direction.

Basically, I want to embed it in the theme where people will be able to buy the whole customized theme. It’ll only be a one time procedure

How Can I Copy A Script Of Web site? [closed]

I am a wordpress webdesigner. I never work on html or php or anything else. there is a website, and I am using on my private life. I am not owner of that. That is a auction hunter. For ebay or for allegro and etc. I dont know how it s working. probably a script. ıf you dont have an idea about auctions, i can tell shortly. people are selling their products with auction. price is starting from 1 eur. everybody make bids. You can write your max offer on this website and this website is working as a human till limit of your max offer.

I want to copy this website on my hosting and use for myself. That website will not be public. i will use for myself. how can i copy it?

Creating a database error in installing autoresponder program

Installed autoresponder program in php but when running it I get the following error.

CREATE TABLE IF NOT EXISTS bft_smails ( id int(10) unsigned NOT NULL auto_increment, sender
varchar(255) NOT NULL default ”, receiver varchar(255) NOT NULL default ”, subject varchar(255)
NOT NULL default ”, message text NOT NULL, date date NOT NULL default ‘0000-00-00’, mailtype varchar(10) default NULL, read int(10) unsigned NOT NULL default ‘0’, sent
int(10) unsigned NOT NULL default ‘0’, track tinyint(3) unsigned NOT NULL default ‘0’,
list_id int(10) unsigned NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM:
You have an error in your SQL syntax; check the manual that corresponds to your
MariaDB server version for the right syntax to use near ‘TYPE=MyISAM’ at line 14

I am new to databases and php.
Any help would be appreciated.

I don’t know how to proceed.

doctrine-migrations cannt run with api when the database driver is sqlite

I’m trying to integrate doctrine/migrations into the TP5 framework for unit testing purposes, so I need to use the API provided by doctrine-migrations to run migrations instead of the CLI. However, I encountered this error when using the SQLite engine: The metadata storage is not initialized, please run the sync-metadata-storage command to fix this issue.

There is my code

$connectionLoader = new ConfigurationFile('./migrations-db.php');
$configurationLoader = new ConfigurationFileWithFallback('./migrations.php');
$dependencyFactory = DependencyFactory::fromConnection($configurationLoader, $connectionLoader);
$version = $dependencyFactory->getVersionAliasResolver()->resolveVersionAlias('latest');
$planCalculator = $dependencyFactory->getMigrationPlanCalculator();
$plan = $planCalculator->getPlanUntilVersion($version);
$migrator = $dependencyFactory->getMigrator();
$migratorConfigurationFactory = $dependencyFactory->getConsoleInputMigratorConfigurationFactory();
$migratorConfiguration = $migratorConfigurationFactory->getMigratorConfiguration(new ArrayInput([]));
$sql = $migrator->migrate($plan, $migratorConfiguration);

There is my migrations-db.php

<?php
// return [
//     'driver' => 'pdo_mysql',
//     'host' => '127.0.0.1',
//     'port' => 13306,
//     'password' => 'zhihui',
//     'dbname' => 'migration',
//     'user' => 'root',
// ];

return [
    'driver' => 'pdo_sqlite',
    'dbname' => ':memory:',
];

As you can see, everything works fine when the driver is ‘mysql_pdo’.

However, strangely enough, no matter which driver I choose, running doctrine-migrations:migrate in the CLI works without any issues.”

Papara curl null responding

For a while solving papara payment issues. i think i did everything correctly but curl not responding me..
Here is documentation https://merchant-api.papara.com/

and here is my codes for Qr payment

$paparaID        = 123456;
$api_key         = 'XXX';
$secure_key      = 'XXX';
$environment_url = 'https://merchant-api.papara.com/qrpayments';

$payload = array(
    "amount"           => 99.99, //opsiyonel
    "referenceId"      => $paparaID,
    "orderDescription" => "Kullanıcının ödeme sayfasında göreceği açıklama",
    "notificationUrl"  => "https://www.oyuntuccari.com/bakiye/obpapara", //opsiyonel
    "redirectUrl"      => "https://www.oyuntuccari.com/bakiye/obpapara", //opsiyonel
    "currency"         => 0 //opsiyonel
);

$header = [
    "ApiKey:" . $api_key,
    "Content-Type: application/json"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $environment_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);

$result = curl_exec($ch);

if (curl_errno($ch)) {
    print "Error: " . curl_error($ch);
    exit();
}

curl_close($ch);

$result = json_decode($result, 1);

I hope papara developers help me on stackoverflow.

Http Authentication in PHP not working on new hosting [closed]

Moved my website to Siteground shared hosting and http authentication stopped working on their server.

        if (!isset($_SERVER['PHP_AUTH_USER'])) {
        header('WWW-Authenticate: Basic realm="huahin"');
        header('HTTP/1.0 401 Unauthorized');
        echo 'Unauthorized';
        exit;
    } else {
        if($_SERVER['PHP_AUTH_USER']!='mylogin'){
        header('WWW-Authenticate: Basic realm="huahin"');
        header('HTTP/1.0 401 Unauthorized');
    } else {
        if($_SERVER['PHP_AUTH_PW']!='mypassword'){
        header('WWW-Authenticate: Basic realm="huahin"');
        header('HTTP/1.0 401 Unauthorized');
        }
    }

        include('conf.php');

When loading page I am receiving “Unauthorized” message right away.

My htaccess currently looks like that:

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

I’ve tried solution from this topic but it skips authorization and loads content without it.

I am not a developer, just a user who is trying to make things work on a new hosting. Thank you in advance for your help.

Allotment Request Form DateTime Group Problem

I am preparing a project, I am preparing an allocation form, but I am having a problem,

While creating the table, I want to group the incoming date data according to the quota data. So let me explain it like this:

Current uutput:

The output I want:

The code block where I make Excel operations:

/////////////////////// EXCEL ISLEMLERI
    $hcode = $veri[0]->hcode;
    $rtype = $veri[0]->rtype;
    $mailsubject = $veri[0]->mailsubject;
    $sendMailQuery = "SELECT * FROM vakanzsendmail WHERE hcode = ? AND rtype = ? AND mailsubject = ?";
    $sendMailParams = array($hcode, $rtype, $mailsubject);
    $sendMailResult = HALIL::sorgula($sendMailQuery, $sendMailParams);
    $veriExcel = HALIL::sorgula("SELECT * FROM vakanzfillrooms WHERE hcode = ?", array($hcode));
    $spreadsheet = new Spreadsheet();
    $sheet = $spreadsheet->getActiveSheet();
    $sheet->setCellValue('A1', 'BCH');
    $sheet->setCellValue('B1', 'Allotment Request Form');
    $sheet->setCellValue('F1', "Sold" . PHP_EOL . "Rooms");
    $sheet->getStyle('F1')->getAlignment()->setWrapText(true);
    $sheet->setCellValue('G1', "Total" . PHP_EOL . "Allotment");
    $sheet->getStyle('G1')->getAlignment()->setWrapText(true);
    $sheet->setCellValue('H1', "Please fill" . PHP_EOL . "up" . PHP_EOL . "Extra Allot.");
    $sheet->getStyle('H1')->getAlignment()->setWrapText(true);
    $columnHeaders2 = ['Hcode', 'Hotel Name', 'Room Type', 'Date Ranges'];
    $col2 = 'A';
    foreach ($columnHeaders2 as $header2) {
        $sheet->setCellValue($col2 . '2', $header2);
        $col2++;
    }
    function customSort($a, $b) {
        $odaTipiCompare = strcmp($a->rtype, $b->rtype);
        if ($odaTipiCompare == 0) {
            $dateA = strtotime(str_replace('.', '-', $a->mailsubject));
            $dateB = strtotime(str_replace('.', '-', $b->mailsubject));

            return $dateA - $dateB;
        }

        return $odaTipiCompare;
    }
    usort($veriExcel, 'customSort');
    $row = 3;
    $rowHeader = 1;
    $alternateColors = ['#FFFFFF', '#D9D9D9'];
    $currentColorIndex = 0;
    foreach ($veriExcel as $veriex) {
        $otelKodu = $veriex->hcode;
        $otelAdi = $veriex->hname;
        $odaTipi = $veriex->rtype;
        $dolulukTarihAraliklari = $veriex->mailsubject;
        $totalKontenjan = $veriex->total_kontenjan;
        $doluKontenjan = $veriex->dolu_kontenjan;
        $sheet->setCellValue('A' . $row, $otelKodu);
        $sheet->setCellValue('B' . $row, $otelAdi);
        $sheet->setCellValue('C' . $row, $odaTipi);
        $sheet->setCellValue('D' . $row, $dolulukTarihAraliklari);
        $sheet->setCellValue('E' . $row, $dolulukTarihAraliklari);
        $sheet->setCellValue('F' . $row, $totalKontenjan);
        $sheet->setCellValue('G' . $row, $doluKontenjan);
        foreach (range('A', 'H') as $columnName) {
            $sheet->getStyle($columnName . $row)->getAlignment()->setHorizontal(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_CENTER);
            $sheet->getStyle($columnName . $row)->getAlignment()->setVertical(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_CENTER);
            $sheet->getStyle($columnName . $rowHeader)->getAlignment()->setHorizontal(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_CENTER);
            $sheet->getStyle($columnName . $rowHeader)->getAlignment()->setVertical(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_CENTER);
            $sheet->getStyle($columnName . $row)->getBorders()->getAllBorders()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THIN);
            $sheet->getStyle($columnName . $rowHeader)->getBorders()->getAllBorders()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THIN);
            $sheet->getStyle($columnName . '2')->getBorders()->getAllBorders()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THIN);
            $sheet->getStyle($columnName . '2')->getAlignment()->setHorizontal(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_CENTER);
            $sheet->getStyle($columnName . '2')->getAlignment()->setVertical(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_CENTER);
            
        }
        $sheet->getStyle('A' . $rowHeader . ':H' . $rowHeader)->getFont()->setBold(true);
        $sheet->getStyle('A' . $rowHeader . ':H' . $rowHeader)->getFont()->setSize(13);
        $sheet->getStyle('A1:H2')->getFont()->setBold(true);
        $sheet->getStyle('A1:H2')->getFont()->setSize(13);
        $colors = [
            0 => 'FFFFFF', // Durum 0 için beyaz
            1 => '54ff9f', // Durum 1 için yeşil
            2 => 'FFFF00', // Durum 2 için sarı
            3 => 'ff6a6a', // Durum 3 için kırmızı
        ];
        $queryDurum = "SELECT durum FROM vakanzhcode WHERE hcode = ? AND rtype = ? AND mailsubject = ?";
        $paramsDurum = array($otelKodu, $odaTipi, $dolulukTarihAraliklari);
        $resultDurum = HALIL::sorgula($queryDurum, $paramsDurum);
        if ($resultDurum && count($resultDurum) > 0) {
            $durum = $resultDurum[0]->durum;
        } else {
            $durum = 0;
        }
        $sheet->getStyle('A' . $row . ':H' . $row)->applyFromArray([
            'fill' => [
                'fillType' => PhpOfficePhpSpreadsheetStyleFill::FILL_SOLID,
                'startColor' => [
                    'rgb' => $colors[$durum], 
                ],
            ],
        ]);
        $sheet->mergeCells('B1:E1'); 
        $sheet->mergeCells('D2:E2'); 
        $sheet->mergeCells('F1:F2'); 
        $sheet->mergeCells('G1:G2'); 
        $sheet->mergeCells('H1:H2'); 
        
        $sheet->getRowDimension(1)->setRowHeight(40);
        $sheet->getColumnDimension('F')->setAutoSize(true);
        $sheet->getColumnDimension('G')->setAutoSize(true);
        $sheet->getColumnDimension('H')->setAutoSize(true);
        $cellWidths = [
            strlen($otelKodu) * 2.5,
            strlen($otelAdi) * 2,
            strlen($odaTipi) * 1.4,
            strlen($dolulukTarihAraliklari) * 2.5,
            strlen($dolulukTarihAraliklari) * 2.5,
        ];
        foreach (range('A', 'E') as $columnIndex => $columnName) {
            $sheet->getColumnDimension($columnName)->setWidth($cellWidths[$columnIndex]);
        }
        
        $row++;
    }
    $imagePath = 'imaj/logocsv.png';
    $drawing = new Drawing();
    $drawing->setName('Logo');
    $drawing->setDescription('Company Logo');
    $drawing->setPath($imagePath);
    $drawing->setCoordinates('A1');
    $drawing->setResizeProportional(true);
    $drawing->setWidthAndHeight(88, 54);
    $drawing->setWorksheet($sheet);
    $writer = new Xlsx($spreadsheet);
    $tarihFormati = date("d_m_y");
    $fileNameHotel = $veriExcel[0]->hname;
    $uniqueNumber = rand(100000, 999999);
    $fileName = "{$fileNameHotel}-{$tarihFormati}-{$uniqueNumber}-Occupancy-List.xlsx";
    $excelDosyaYolu = "vakanzfillroomsspreadsheets/{$fileName}";
    $writer->save($excelDosyaYolu);

/////////////////////// EXCEL ISLEMLERI

I tried a few methods but I could not reach the result, I give the example below from the database I pulled from sql.

INSERT INTO `vakanzfillrooms` (`id`, `hcode`, `hname`, `rtype`, `mailsubject`, `mail`, `total_kontenjan`, `dolu_kontenjan`) VALUES
(426, 'ANDEI', 'Hotel Name', 'Hotel Code', '01.10.2023', '[email protected]', 3, 3),
(427, 'ANDEI', 'Hotel Name', 'Hotel Code', '02.10.2023', '[email protected]', 3, 3),
(428, 'ANDEI', 'Hotel Name', 'Hotel Code', '03.10.2023', '[email protected]', 3, 3),
(429, 'ANDEI', 'Hotel Name', 'Hotel Code', '04.10.2023', '[email protected]', 3, 3),
(430, 'ANDEI', 'Hotel Name', 'Hotel Code', '06.10.2023', '[email protected]', 4, 4),
(431, 'ANDEI', 'Hotel Name', 'Hotel Code', '07.10.2023', '[email protected]', 4, 4),
(436, 'ANDEI', 'Hotel Name', 'Hotel Code', '03.11.2023', '[email protected]', 4, 4),

Let me share one of my experiments with you

    // Verileri tarihe göre sıralayın
    usort($veriExcel, 'customSort');

    // Gruplandırılmış verileri tutmak için bir dizi oluşturun
    $groupedData = [];
    $currentGroup = [];

    // Verileri gruplandırın
    foreach ($veriExcel as $veriex) {
        $otelKodu = $veriex->hcode;
        $otelAdi = $veriex->hname;
        $odaTipi = $veriex->rtype;
        $dolulukTarihAraliklari = $veriex->mailsubject;
        $totalKontenjan = $veriex->total_kontenjan;
        $doluKontenjan = $veriex->dolu_kontenjan;

        // Tarihi bir sonraki tarihe eklemek için strtotime kullanın
        if (empty($currentGroup) || strtotime($dolulukTarihAraliklari) == strtotime('+1 day', strtotime(end($currentGroup)['dolulukTarihAraliklari']))) {
            $currentGroup[] = [
                'otelKodu' => $otelKodu,
                'otelAdi' => $otelAdi,
                'odaTipi' => $odaTipi,
                'dolulukTarihAraliklari' => $dolulukTarihAraliklari,
                'totalKontenjan' => $totalKontenjan,
                'doluKontenjan' => $doluKontenjan,
            ];
        } else {
            // Eğer önceki tarih ile bir sonraki tarih bir gün aralıklı değilse, mevcut grup tamamlandı
            $groupedData[] = $currentGroup;
            $currentGroup = [
                [
                    'otelKodu' => $otelKodu,
                    'otelAdi' => $otelAdi,
                    'odaTipi' => $odaTipi,
                    'dolulukTarihAraliklari' => $dolulukTarihAraliklari,
                    'totalKontenjan' => $totalKontenjan,
                    'doluKontenjan' => $doluKontenjan,
                ]
            ];
        }
    }

    // Son gruplandırmayı ekleyin
    $groupedData[] = $currentGroup;

    // Geri kalan kod aynı kalabilir
    $row = 3;
    $rowHeader = 1;
    $alternateColors = ['#FFFFFF', '#D9D9D9'];
    $currentColorIndex = 0;
    // Verileri gruplandırılmış şekilde döngüye alın
    foreach ($groupedData as $group) {
        // Grubun her bir öğesini işleyin
        foreach ($group as $veriey) {
            $otelKodu = $veriey['otelKodu'];
            $otelAdi = $veriey['otelAdi'];
            $odaTipi = $veriey['odaTipi'];
            $dolulukTarihAraliklari = $veriey['dolulukTarihAraliklari'];
            $totalKontenjan = $veriey['totalKontenjan'];
            $doluKontenjan = $veriey['doluKontenjan'];

I tried to get it into the group in this way, but there was no change in the output.

Read kubernetes job in PHP

I’m very new in PHP. I’ve been looking around, but couldn’t find an example to guide myself after.

I have a k8s job and some PHP code. In PHP, I need to test if the job is complete.

Here’s the status part of my job:

status:
  conditions:
    - type: Complete
      status: 'True'
      lastProbeTime: '2023-09-15T08:54:52Z'
      lastTransitionTime: '2023-09-15T08:54:52Z'
  startTime: '2023-09-15T08:54:14Z'
  completionTime: '2023-09-15T08:54:52Z'
  succeeded: 1
  uncountedTerminatedPods: {}
  ready: 0

And this is the PHP code I am using:

    public function wait_for_copy_job($namespace)
    {
        $API = new KubernetesAPIJob();
        $copy_data = $API->read($namespace, "copy-user-data");
        return $copy_status->status->conditions[0]->type;
    }
            while ($copy_status != "Complete"){
                echo "not done yet";
            }

            echo "done";

Needless to say that my while loop goes on forever, even though the job status is Complete. What exactly am I doing wrong?

How can I edit the .env file from filament dasboard?

I’m building a new laravel dashboard using the Filament library. I want to add some settings that allow the user to change some .env values namely the website URL and the DEBUG mode. This is my implementation:

Card::make()->schema([
    TextInput::make('siteUrl')
        ->label('URL')
        ->placeholder('http://localhost')
        ->helperText('Required for file uploads and other internal configs')
        ->required(),
    Toggle::make('debugEnabled')
        ->label('Is Enabled')
        ->helperText('Enable/Disable debug mode to help debug errors')
]),

This successfully saves the settings to the database but I can’t figure out how I can persist the changes into the .env file.

Any help would be appreciated. Thanks

Running exec(“nohup curl …”) in PHP and redirecting stderr

I have a piece of php code that executes multiple curl request using the exec() function. The goal is to download a lot of files simultaneously, at the same keep track of the PIDs as well as the progress. A simplified version is like this:

<?php
// some code here
unset($pid);
for($i=1;$i<=100;$i++) {
    exec("nohup curl '".$url[$i]."' -o output-".$i.".dat > log/".$i.".log & echo $!",$pid[$i]);
}
// some code here
?>

where

$url[] is an array containing a lot of urls

$pid[] is an array containing the PID of the curl process. I need this to check if the process is finished, then perform other tasks.

output-i.dat is the downloaded files

log/i.log is a text file containing the process generated by curl in cli. I need this to make sure the file is 100% downloaded and connection is not lost mid-way

The reason I need to use nohup is to obtain the PID, without nohup I cannot get the PID from echo $!

This script works and achieved what I need however when I run the code in cli php download.php the screen will be flooded with

nohup: redirecting stderr to stdout
nohup: redirecting stderr to stdout
......
nohup: redirecting stderr to stdout
nohup: redirecting stderr to stdout

I want to know if there is anyway to pipe this output to /dev/null

I tried to include > /dev/null 2>&1 in the php like this

exec("nohup curl '".$url[$i]."' -o output-".$i.".dat > log/".$i.".log > /dev/null 2>&1 & echo $!",$pid[$i]);

but it does not work. Neither will this work:

exec("nohup curl '".$url[$i]."' -o output-".$i.".dat > log/".$i.".log 2>/dev/null & echo $!",$pid[$i]);

I was hoping there is a quiet switch for nohup but it does not seem to have one.

Mysql excution time out exception not working on server


 try {
            $result = DB::select("select COUNT(*) FROM ee_suborders WHERE metaData LIKE '%Umakant%'");
            print_r($result);
            Log::info("Exception Test Data", [$result]);
        } catch (Exception $e) {
            Log::info("Exception Test Error", [$e->getMessage(), $e->getCode(), $e->getFile(), $e->getLine()]);
        }

Laravel
This code throwing Exception on MySQL max_execution_time out for 100 second but it is not throwing Exception on server even database is same in local and server

I check configuration looks similar on local and server

Export blade using laravel-dompdf version 2.0

i try to export a blade view using the package barryvdh/laravel-dompdf
but i get an error

Undefined array key “” in
/var/www/html/vendor/dompdf/dompdf/lib/Cpdf.php line 4752
/var/www/html/vendor/dompdf/dompdf/src/Adapter/CPDF.php”, line: 806, function: “getFontHeight”,
…..
etc…..
/var/www/html/app/Http/Controllers/PdfController.php”,
line: 193

Here is my PdfController line 193

192: $pdf = Pdf::loadView("template.pdf"); 
193: Storage::disk('local')->put('public/pdf/test.pdf',$pdf->output());

here is my template/pdf.blade.php

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>PDF </title>
</head>

<body>TEST</body>
</html>

but when I try with barryvdh/laravel-dompdf version 1.0, iIt outputs correctly.What’s the problem?

What is this error in Apache access log: “POST /ussd HTTP/1.1” 406 344 “-” “bf-am-http”?

I’m trying to build a USSD, the operator is sending my a SOAP request but the Apahce access log is showing this error:

OperatorIP – – [Timestamp] “POST /ussd HTTP/1.1” 406 344 “-” “bf-am-http”

The request is coming to https://example.com/ussd.php, (using RewriteRule to get rid of .php), and the ussd.php file contains these lines only:

#Get the inputs and log them to a file to see the contents
$requestBody = trim(file_get_contents('php://input');
file_put_contents("ussdbody.json");
$requestServer = json_encode(array('data' => as $_SERVER));
file_put_contents("ussdserver.json");
echo "Welcome to the ussd";

If I access https://example.com/ussd with a web browser or Postman, ussdbody.json & ussdserver.json will be updated with the body & server content.
But when the operator sends the USSD request, nothing changes in those files and all I can see in the access log is the error above.

I even tried disabling firewalld thinking it might be a firewall issue, but nothing changed.