Answer the question
In order to leave comments, you need to log in
Why is the file not being moved to the folder?
Hello! I need to download an html page and put it in a separate folder.
I found an example in the open spaces:
I create a file crontask.php
<?php
exec ('wget -O somefile.html -x http://www.example.com/somefile.html');
exec ('mv somefile.html ./myfolder/');
?>
/usr/local/bin/php -f /home/accountname/site.com/www/crontask.php
mv: cannot move `somefile.html' to `./myfolder/': Not a directory
Answer the question
In order to leave comments, you need to log in
exec('mv somefile.html ./myfolder/');
Specify full paths to somefile.html and myfolder. The command is not executed in the default directory where you expect it to be.
Try like this:
cd /home/accountname/site.com/www/; /usr/local/bin/php -f crontask.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question