Jump to content

php and apache trouble with http chunk encoding


Gaston

Recommended Posts

Hi to all, I installed php8.3 and apache2 on ubuntu OS 64. I have used php to get data from post request but now I need to get data from chunked data from encoding http header. I found some threads in different forum about this matter and points to edit php.ini or install php-fpm (which I did). In order to get data incoming from post request I use:

 $data = file_get_contents('php://input');

which needs to disable this variable in php.ini

enable_post_data_reading

But Im unable to get data incoming from encoding, just empty array. So that is why I installed php-fpm and tried to get again data. But again nothing. I found this thread link in which explain more or less about this issue with php but how do I configure php-fpm? in apache2 default config I got this (see image below)

I tried this code also:

<?php
// phpinfo();
//if($_SERVER['REQUEST_METHOD']=='POST')
    $data = file_get_contents('php://input'); 
    $file = fopen("data.txt", "w");
    fwrite($file, $data);
    fclose($file); 
?>

but nothing. So the main question is ...how do i get those data coming from POST request with chunked encoding? How to set apache2 or php to be able to gt those data?

By the way..I use tigershark to check http and the data is sent. I tried with normal header and and small php and all work like a charm. But using encoding I can't see nothing at all.

Regards

Gastón

php_conf.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.