PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > php exec() and similar functions do not write on disk using iis
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
php exec() and similar functions do not write on disk using iis

Réponse
 
LinkBack Outils de la discussion
Vieux 04/03/2008, 22h23   #1
arko
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut php exec() and similar functions do not write on disk using iis

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
  Réponse avec citation
Vieux 05/03/2008, 12h54   #2
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php exec() and similar functions do not write on disk using iis

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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h22.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09148 seconds with 10 queries