PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > PHP and WGET generate 0 byte files
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP and WGET generate 0 byte files

Réponse
 
LinkBack Outils de la discussion
Vieux 07/11/2007, 21h12   #1
Don69
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP and WGET generate 0 byte files

I have a problem with PHP where wget generates 0 byte files. Below
is
the code that I use.

// ********************
$savedir = "/webroot/vifs/app/webroot/static/1234567890";
$url = "http://www.google.com";


$test = mkdir( $savedir, 0777);


exec("/usr/bin/wget -nH -nd -d -P$savedir $url");
// ********************


What I have noticed is that if the directory already exists, WGET
works fine. But if the directory is created prior to, as shown in
the
code, WGET generates a file of 0 bytes.


MKDIR always returns successfully.


I've tried inserting a SLEEP(5) after MKDIR and that does not .


Would anyone know why this is happening?


Thanks

  Réponse avec citation
Vieux 08/11/2007, 05h25   #2
lawrence k
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP and WGET generate 0 byte files

On Nov 7, 3:12 pm, Don69 <vaillancourt....@gmail.com> wrote:
> I have a problem with PHP where wget generates 0 byte files. Below
> is
> the code that I use.
>
> // ********************
> $savedir = "/webroot/vifs/app/webroot/static/1234567890";
> $url = "http://www.google.com";
>
> $test = mkdir( $savedir, 0777);
>
> exec("/usr/bin/wget -nH -nd -d -P$savedir $url");
> // ********************
>
> What I have noticed is that if the directory already exists, WGET
> works fine. But if the directory is created prior to, as shown in
> the
> code, WGET generates a file of 0 bytes.
>
> MKDIR always returns successfully.
>
> I've tried inserting a SLEEP(5) after MKDIR and that does not .
>
> Would anyone know why this is happening?



Is safe mode on? I once had a problem with PHP not writing to a
directory that had been chmoded 0777. Turned out the problem was safe
mode. I turned it off and then things worked fine.

However, that is a long shot. My first guess is that this is more of a
wget issue than a PHP issue.




  Réponse avec citation
Vieux 08/11/2007, 12h46   #3
bushido
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP and WGET generate 0 byte files

On Nov 8, 3:12 am, Don69 <vaillancourt....@gmail.com> wrote:
> I have a problem with PHP where wget generates 0 byte files. Below
> is
> the code that I use.
>
> // ********************
> $savedir = "/webroot/vifs/app/webroot/static/1234567890";
> $url = "http://www.google.com";
>
> $test = mkdir( $savedir, 0777);
>
> exec("/usr/bin/wget -nH -nd -d -P$savedir $url");
> // ********************
>
> What I have noticed is that if the directory already exists, WGET
> works fine. But if the directory is created prior to, as shown in
> the
> code, WGET generates a file of 0 bytes.
>
> MKDIR always returns successfully.
>
> I've tried inserting a SLEEP(5) after MKDIR and that does not .
>
> Would anyone know why this is happening?
>
> Thanks


-P$savedir => -P $savedir

  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 16h50.


É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,09888 seconds with 11 queries