Andreas Paasch wrote:
According to the manual for PHP, I should be able to run a shell command
within php.
I'm trying to copy some php files from one location to another one using
exec() but fail.
- if(exec("/bin/cp -f /home/web/public/min-pizza/master/
- /home/web/public/min-pizza/$postnr/$folder/") == TRUE)
- echo "... masterfiles copied ...";
-
$postnr = 2720
$folder = 38747117-robertos
They are created dynamically and must stay as they are, it's a standard
format for creating folders and consequently copying files.
But can't do it ... I've read and read, found no solution so far.
Any help is highly welcome.
Actually, I stumpled over the obvious - PHP function copy().
Didn't even get that to work, however in the notes a nice little function
was written so I tested that - works like a charm now.
I don't have any PHP limitations set, so that's not the issue, I have tried
system() too, to no avail. It must somehow be related to my syntaxing.
Now, about the recursive option for copy, it's only needed if I want
subdirectories copied, which isn't the case, I only wanted all files from
/master/ to be copied to the newly created folder.
But, the function mentioned works so for now I go on with my coding, my
optimizing it all is a later chapter ....
Thanks anyways, always helps to get some new eyes on problems.
/Andreas
--
Registeret Linux user #292411