Re: exec('make') Q

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, January 22, 2007 5:45 pm, james@xxxxxxxxxxx wrote:
> Here's a simple makefile I want PHP's exec to execute make on:
>
> KEYLIST := keylist.txt
> DEPS := $(wildcard *.txt)
> FILES := *.txt
>
> $(KEYLIST): $(DEPS)
> grep ^keywords $(FILES) > $@
>
> now when I use make from command line, it works as expected,
> the keylist.txt file is created. however, when I use PHP exec
> to run make on the makefile, the keylist.txt file is not generated.
>
> * if keylist.txt does not need updating, PHP exec make works,
> make says keylist.txt is up to date.
> * if i remove redirection, PHP exec make shows that grep is
> making the same matches as make from commandline.
>
> Why does the redirection of the grep command (within the makefile)
> only work when I execute make from the commandline but not from
> PHP exec||shell_exec?
>
> One sollution is to abandon redirection and get the output from
> grep into a string and then get PHP to create keylist.txt, but
> why do that?

When your web-server runs PHP, it is NOT running as 'you'
It is running as a different user with different permissions.
Almost for sure, that user does not have permission to create files in
that directory.
This would exactly match the description you gave.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux