php exec not working after uploading

  • 16 years ago

    hi! im new here. im still starting to explore php codes. and now im doing a program in uploading files.


    i used to upload an image in the server


    $uploadfile = "/var/www/images/";
    moveuploadedfile($FILES['filefield']['tmpname'], $uploadfile);


    then i used
    chmod($uploadfile, 0777);
    to change its mode so i could read it.


    afterwards, i used
    $bmpname = "pic.bmp";
    exec('cd /var/www/images/');
    exec('/usr/local/otb2sms -r -l 515 03 $bmpname > sample.txt' );


    the exec statement is not working.
    but when i type it in the server, it works. but why not on the php code?


    before, i used this and it worked. it was until the time that i used chmod when it started not working. does chmod has something to do why id didnt work?

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - Rick Osborne