0

I'm trying to access post data using file_get_contents, however I get the following error message:

failed to open stream: HTTP request failed! HTTP/1.0 411 Length Required.

Although I used Content-Length field the error doesn't get solved. Here is my code if someone can help me, thanks in advance.

<?php
set_time_limit(0);
include "ui.php";
$oy= `perl E:/mul.pl`;
$context  = stream_context_create(array('http' => array('method'=>'POST', 'header'  => 'Content-type: application/x-www-form-urlencoded', 'Content-Length: 0', 'content' => '')));
$result = file_get_contents($oy, false, $context);
?>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Pradeep
  • 1
  • 1

1 Answers1

0

you can use apache_note and virtual php function for run perl

or see this page's for execute perl by php shell functions

Execute perl in PHP

How can I call a Perl script from PHP?

using shell_exec to call a perl script from php

Problems executing Perl scripts from PHP

Community
  • 1
  • 1
mohammad mohsenipur
  • 3,218
  • 2
  • 17
  • 22