It's always the smallest things that will get you, I should be slapped
(preferably by a good looking woman) :) ....

exec was not broken
the permissions don't have to be mucked with
ownership and group can be left alone
this should be stamped on the forehead of each and every PHP developer


$bash = "#!/bin/sh";
$curl = "/usr/local/bin/curl -d
\"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html";;
$sh = fopen("/var/www/htdocs/rcr/", "w+");
   fputs($sh, $bash."\n\n");
   fputs($sh, $curl);
chmod("/var/www/htdocs/rcr/", 0755);

This solved all of the problems. I did the full paths thing during the
process of elimination, to remove all doubt about the code. This will make
sure that the script can be found and executed.

On another note;

Had I done this with exec and the cURL statement earlier it would have
worked as well. But I think that i am going to keep it this way as it will
hopefully make the code clearer. I will have to write more cURL statements
later in the script and I can then assemble shell scripts as needed.

Thanks for all of your help...


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to