One attempt, with a progress bar.
#!/usr/bin/php
<?php
if (@$argv[1] != null){
echo "Retrieving http header...";
$header = get_headers("$argv[1]");
$pp = "0";
echo json_encode($header, JSON_PRETTY_PRINT);
$key = key(preg_grep('/\bLength\b/i', $header));
$type = key(preg_grep('/\bType\b/i', $header));
$http = substr($header[0], 9, 3);
$tbytes = @explode(" ",$header[
type = @explode("/",explode(" ",$header[$type])[1])[1];
echo " Target size: ".floor((($tbytes / 1000)/1000))." Mo || ".floor(($tbytes/1000))." Kb";
$t = explode("/",$argv[1]);
$remote = fopen($argv[1], 'r');
t[count(
type";
$local = fopen(
read_bytes = 0;
echo PHP_EOL;
while(!feof($remote)) {
$buffer = fread($remote, intval($tbytes));
fwrite($local, $buffer);
$read_bytes += 2048;
$progress = min(100, 100 * $read_bytes / $tbytes);
$progress = substr($progress,0 , 6) *4;
$shell = 10; /* Progress bar width */
shell * $progress / 100;
echo " \033[35;2m\e[0m Downloading: [".round($progress,3)."%] ".floor((($read_bytes/1000)*4))."Kb ";
if (
shell){$pp=0;};
if ($rt === $shell){$rt=0;};
echo str_repeat("█",$rt).str_repeat("=",($pp++)).">@\r";
usleep(1000);
}
echo " \033[35;2m\e[0mDone [100%] ".floor((($tbytes / 1000)/1000))." Mo || ".floor(($tbytes/1000))." Kb \r";
echo PHP_EOL;
fclose($remote);
fclose($local);
}

The file is build directly into the current folder, not in the temp directory. This mean the file can be read while downloading. If the file type is made to handle that, like most media format do.
To use, pass an url as first argument in the command line.
./pget https://site.download.mp4
You know you want to tweek it ;)
Answer from NVRM on Stack OverflowVideos
One attempt, with a progress bar.
#!/usr/bin/php
<?php
if (@$argv[1] != null){
echo "Retrieving http header...";
$header = get_headers("$argv[1]");
$pp = "0";
echo json_encode($header, JSON_PRETTY_PRINT);
$key = key(preg_grep('/\bLength\b/i', $header));
$type = key(preg_grep('/\bType\b/i', $header));
$http = substr($header[0], 9, 3);
$tbytes = @explode(" ",$header[
type = @explode("/",explode(" ",$header[$type])[1])[1];
echo " Target size: ".floor((($tbytes / 1000)/1000))." Mo || ".floor(($tbytes/1000))." Kb";
$t = explode("/",$argv[1]);
$remote = fopen($argv[1], 'r');
t[count(
type";
$local = fopen(
read_bytes = 0;
echo PHP_EOL;
while(!feof($remote)) {
$buffer = fread($remote, intval($tbytes));
fwrite($local, $buffer);
$read_bytes += 2048;
$progress = min(100, 100 * $read_bytes / $tbytes);
$progress = substr($progress,0 , 6) *4;
$shell = 10; /* Progress bar width */
shell * $progress / 100;
echo " \033[35;2m\e[0m Downloading: [".round($progress,3)."%] ".floor((($read_bytes/1000)*4))."Kb ";
if (
shell){$pp=0;};
if ($rt === $shell){$rt=0;};
echo str_repeat("█",$rt).str_repeat("=",($pp++)).">@\r";
usleep(1000);
}
echo " \033[35;2m\e[0mDone [100%] ".floor((($tbytes / 1000)/1000))." Mo || ".floor(($tbytes/1000))." Kb \r";
echo PHP_EOL;
fclose($remote);
fclose($local);
}

The file is build directly into the current folder, not in the temp directory. This mean the file can be read while downloading. If the file type is made to handle that, like most media format do.
To use, pass an url as first argument in the command line.
./pget https://site.download.mp4
You know you want to tweek it ;)
In my opinion, the easiest way is:
$fileContent = file_get_contents('/home/lokesh/lalu.txt');
If I correctly understood.
Use the Dotdeb Debian stable packages. Although the documentation does not note this, the stable packages currently work fine with Wheezy/testing. After following the instructions, do:
apt-get install php5-cli
as root.
After installing php5-cli from dotdeb, install the php5-readline package.
apt-get install php5-readline
Did you get your version of PHP from? http://windows.php.net/download/ I've just downloaded the ZIP from there and it contained php-win.exe
Check you've not accidentally downloaded the php source
Tutorial
recommendation: install powershell latest version
Install scoop - https://scoop.sh/
1- on powershell: iwr -useb get.scoop.sh | iex
Install php (latest version)
- scoop install php
Install php (specific version)
- scoop bucket add php
- scoop search php
- scoop install php/php7.4.26
Install composer
- scoop install composer
Composer/php folder:
- C:\Users\username\scoop\apps\php7.4
- C:\Users\username\scoop\apps\composer
where to config composer/php manually
- C:\Users\username\scoop\persist
enable php extensions
- on terminal
cd C:\Users\username\scoop\persist - on terminal(will open vscode)
code . - edit C:\Users\username\scoop\persist\php7.4\conf.d\extensions.ini
extensions.ini - example
extension=php_openssl.dll
extension=fileinfo
extension=curl
extension=pdo_sqlite
extension=pdo_mysql
extension_dir=C:\Users\username\scoop\apps\php7.4\7.4.26\ext