|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I use php 5 on iis in a windows 2003 server machine.
I should start through php a dos program which should write an output on disk, but it doesn't. I can't write anything on disk this way. I used exec() funtion and similar, but they don't work. For example, this code <? $c = "dir c:\\ > c:\\inetpub\\wwwroot\\something\\foo.txt"; exec("$c"); ?> does not create the file foo.txt. You should know that - The programs are run, as i could check using passthru() rather than exec(), but they don't write on disk - I have given permission to the internet user to write in the directory where the file should be created - I have given permission to run the programs called by exec() - I have allowed to run executable programs in iis Anyone can ? Thank you very much |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
arko wrote:
> I use php 5 on iis in a windows 2003 server machine. > I should start through php a dos program which should write an output > on disk, > but it doesn't. I can't write anything on disk this way. I used exec() > funtion and > similar, but they don't work. For example, this code > Hi, > <? > $c = "dir c:\\ > c:\\inetpub\\wwwroot\\something\\foo.txt"; > exec("$c"); Why not: exec($c); ?? Why add the ""? > ?> > > does not create the file foo.txt. Why should it? Your 'command' doesn't make sense. Type that into your commandprompt (without the extra \ of course): does that create the file foo.txt? No. Not here. ;-) Or are you trying to execute foo.txt? If you want to invoke a doslike shell, start your command at least with cmd or command. Did you check the reference? Here you can find it: http://nl2.php.net/manual/en/ref.exec.php Be sure to read the first note for an example for dos. (Which is actually chronologically the last note). It contains an example with some advise about extra parameters. You can also let PHP create a directory or file: http://nl2.php.net/manual/en/function.fwrite.php and http://nl2.php.net/manual/en/function.mkdir.php Hope that s. Regards, Erwin Moller > > You should know that > - The programs are run, as i could check using passthru() rather than > exec(), but > they don't write on disk > - I have given permission to the internet user to write in the > directory where the file > should be created > - I have given permission to run the programs called by exec() > - I have allowed to run executable programs in iis > > Anyone can ? > > Thank you very much |
|
![]() |
| Outils de la discussion | |
|
|