Answer the question
In order to leave comments, you need to log in
Why doesn't exec output anything, although there is output through the command line?
<?php
$returnStrings = [];
$returnCode = 0;
$e = exec('cd /tmp && curl --connect-timeout 10 --max-time 10 --raw --fail --remote-name http://site.ru/123.png', $returnStrings, $returnCode);
var_dump($e);
var_dump($returnStrings);
var_dump($returnCode);
cd /tmp && curl --connect-timeout 10 --max-time 10 --raw --fail --remote-name http://site.ru/123.png
Answer the question
In order to leave comments, you need to log in
how then curl'u specify the root folder to save the file?
cd
don't need it here at all.$ curl --help | grep -i "\-o,"
-o, --output <file> Write to file instead of stdout
-O, --remote-name Write output to a file named as the remote file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question