简体   繁体   中英

Post request getting null at server side?

I have written PHP web service using Laravel framework to upload images using base64 string. it is working fine for small base64 string. but when I tried to generate base64 string of 5 MB image then it is getting NULL requst at server side. here is the PHP server side code:

<?php
  $post_data = file_get_contents("php://input");

  $post_data = json_decode($post_data);
  var_dump($post_data);exit;
 ?>

Useing above source code when I tried to print small base 64 request then it is working fine. When I tried to post large base64 image it is returning NULL.

Please help where I am going wrong. Also please suggest is there any other way to upload large base 64 string at server side.

Also I have tried to edit php.ini at "/Applications/MAMP/bin/php/php7.0.12/conf/php.ini" with the following value

post_max_size 200M
upload_max_filesize 200M

and tried to restart sever but still the same error occurs.

You're probably hitting a PHP limit. Check your php.ini file for the post_max_size and upload_max_filesize settings.

post_max_size = 8M
upload_max_filesize = 2M

If you change these values, you'll need to restart PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM