Re: Re [PHP] cURL in an exec() . more. SOLVED
| From: | Scott Fletcher | Date: | Wed, 03 Jul 2002 16:28:27 +0000 |
| Subject: | Re: Re [PHP] cURL in an exec() . more. SOLVED | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105236@lists.php.net to get a copy of this message | ||
Ha ha! Just what I mentioned from above. FULL PATH!!!!! :-) FletchSOD
"Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message
news:003201c222ac$9760ad90$8102a8c0@niigziuo4ohhdt...
> 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
>
> USE FULL PATHS!
>
> $bash = "#!/bin/sh";
> $curl = "/usr/local/bin/curl -d
> \"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html
> https://theserver.com/download/list.html";
> $sh = fopen("/var/www/htdocs/rcr/getlist.sh", "w+");
> fputs($sh, $bash."\n\n");
> fputs($sh, $curl);
> fclose($sh);
> chmod("/var/www/htdocs/rcr/getlist.sh", 0755);
> exec("/var/www/htdocs/rcr/getlist.sh");
>
> 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...
>
> Jay
>
>
>