I'm trying to streamline some processes on my home server. The idea is...
1 - upload some data in the upload directory
2 - convert it with a shell script and put the converted data in the root
3 - load it into a MySQL database
Steps 1 and 3 are working, step 2 not. After uploading I run the following php script from a webpage:
<?php
exec('./convertWSwin.sed upload/data.txt > data.txt');
echo "Data is converted";
?>
This doesn't work. I have been experimenting for two days with commands like..
exec('mv upload/data.txt ./data.txt');
and
exec('cat upload/data.txt > data2.txt);
but nothing works. I've also tried system(), but that also doesn't work. I've also changed the permissions of the file and folder to 777 (don't worry, I've since changed it back), but also to no avail. The uploaded file has the owner www-data and the permission 644.
So, what am I doing wrong here? How can I run a script on an uploaded file?
Thanks for the help.
Hans