IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Scripts/Batch Discussion :

[BATCH] Exécution automatique de script php


Sujet :

Scripts/Batch

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    30
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 30
    Par défaut [BATCH] Exécution automatique de script php
    Bonjour,

    Voilà j'ai réalisé un script PHP qui marche en local et s’exécute correctement, cependant j'aurais aimé qu'il s’exécute de façon automatique. J'ai donc commencé à créer un fichier batch, mais je rencontre quelques problèmes.

    Le Script PHP étant gros, je vais expliqué rapidement sont fonctionnement :
    Il charge un fichier XML afin de récupérer des informations contenu dedans pour ensuite insérer les données dans une plateforme par l'intermédiaire d'un web service.

    Nom du script PHP : TraitementXML.php
    Nom du XML : ListeApprenantUC2.xml

    Fichier Batch :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    C:\wamp\bin\php\php5.3.5\php.exe C:\wamp\www\TraitementXML.php
    pause
    Erreur observé:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    C:\Windows\system32>C:\wamp\bin\php\php5.3.5\php.exe C:\wamp\www\TraitementXML.p
    hp
    PHP Warning:  simplexml_load_file(): ListeApprenantUC2.xml:2: parser error : Sta
    rt tag expected, '<' not found in C:\wamp\www\TraitementXML.php on line 6
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\www\TraitementXML.php:0
    PHP   2. simplexml_load_file() C:\wamp\www\TraitementXML.php:6
    
    Warning: simplexml_load_file(): ListeApprenantUC2.xml:2: parser error : Start ta
    g expected, '<' not found in C:\wamp\www\TraitementXML.php on line 6
    
    Call Stack:
        0.0016     357392   1. {main}() C:\wamp\www\TraitementXML.php:0
        0.0458     363624   2. simplexml_load_file() C:\wamp\www\TraitementXML.php:6
    
    
    PHP Warning:  simplexml_load_file(): Warning: simplexml_load_file(): ListeAppren
    antUC2.xml:1: parser error : Document in C:\wamp\www\TraitementXML.php on line 6
    
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\www\TraitementXML.php:0
    PHP   2. simplexml_load_file() C:\wamp\www\TraitementXML.php:6
    
    Warning: simplexml_load_file(): Warning: simplexml_load_file(): ListeApprenantUC
    2.xml:1: parser error : Document in C:\wamp\www\TraitementXML.php on line 6
    
    Call Stack:
        0.0016     357392   1. {main}() C:\wamp\www\TraitementXML.php:0
        0.0458     363624   2. simplexml_load_file() C:\wamp\www\TraitementXML.php:6
    
    
    PHP Warning:  simplexml_load_file(): ^ in C:\wamp\www\TraitementXML.php on line
    6
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\www\TraitementXML.php:0
    PHP   2. simplexml_load_file() C:\wamp\www\TraitementXML.php:6
    
    Warning: simplexml_load_file(): ^ in C:\wamp\www\TraitementXML.php on line 6
    
    Call Stack:
        0.0016     357392   1. {main}() C:\wamp\www\TraitementXML.php:0
        0.0458     363624   2. simplexml_load_file() C:\wamp\www\TraitementXML.php:6
    
    
    PHP Notice:  Trying to get property of non-object in C:\wamp\www\TraitementXML.p
    hp on line 15
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\www\TraitementXML.php:0
    
    Notice: Trying to get property of non-object in C:\wamp\www\TraitementXML.php on
     line 15
    
    Call Stack:
        0.0016     357392   1. {main}() C:\wamp\www\TraitementXML.php:0
    
    PHP Fatal error:  Call to a member function children() on a non-object in C:\wam
    p\www\TraitementXML.php on line 15
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\www\TraitementXML.php:0
    
    Fatal error: Call to a member function children() on a non-object in C:\wamp\www
    \TraitementXML.php on line 15
    
    Call Stack:
        0.0016     357392   1. {main}() C:\wamp\www\TraitementXML.php:0
    
    
    C:\Windows\system32>pause
    Appuyez sur une touche pour continuer...
    L'erreur dois provenir de mon fichier Batch !
    Quelqu'un pourrais m'aider ?
    Merci d'avance

  2. #2
    Expert éminent
    Avatar de JML19
    Homme Profil pro
    Retraité : Electrotechnicien Electronicien Informaticien de la SNCF
    Inscrit en
    Décembre 2010
    Messages
    15 191
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Retraité : Electrotechnicien Electronicien Informaticien de la SNCF
    Secteur : Transports

    Informations forums :
    Inscription : Décembre 2010
    Messages : 15 191
    Billets dans le blog
    10
    Par défaut
    Bonjour

    As-tu fait un essai avec un call ou un load, il y a problème de placement en mémoire de l'excécutable php.exe il me semble.
    Vous pouvez utiliser les FAQ (ICI) ou les Tutoriels (ICI) et aussi accéder au blog (ICI)

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    30
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 30
    Par défaut
    Non, je n'est pas essayé, je découvre un peu le langage Batch :/.

    Pourrais tu développez un peu le travail à faire, je n'ai pas bien compris.

    Un truc dans ce style ? :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    C:\wamp\bin\php\php5.3.5\php.exe C:\wamp\www\TraitementXML.php Call ListeApprenantUC2.xml
    pause
    Merci d'avance

  4. #4
    Expert éminent
    Avatar de JML19
    Homme Profil pro
    Retraité : Electrotechnicien Electronicien Informaticien de la SNCF
    Inscrit en
    Décembre 2010
    Messages
    15 191
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Retraité : Electrotechnicien Electronicien Informaticien de la SNCF
    Secteur : Transports

    Informations forums :
    Inscription : Décembre 2010
    Messages : 15 191
    Billets dans le blog
    10
    Par défaut
    Mettre call ou load au début de la ligne de commande.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    call c:\toto.exe ou load c:\toto.exe par exemple.
    Vous pouvez utiliser les FAQ (ICI) ou les Tutoriels (ICI) et aussi accéder au blog (ICI)

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    30
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 30
    Par défaut
    Re,

    Avec Call, j'ai la même erreur et avec Load, j'obtiens ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    C:\Windows\system32>load C:\wamp\bin\php\php5.3.5\php.exe C:\wamp\www\Traitement
    XML.php
    'load' n'est pas reconnu en tant que commande interne
    ou externe, un programme exécutable ou un fichier de commandes.
    
    C:\Windows\system32>pause
    Appuyez sur une touche pour continuer...
    :/

  6. #6
    Expert éminent
    Avatar de JML19
    Homme Profil pro
    Retraité : Electrotechnicien Electronicien Informaticien de la SNCF
    Inscrit en
    Décembre 2010
    Messages
    15 191
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Retraité : Electrotechnicien Electronicien Informaticien de la SNCF
    Secteur : Transports

    Informations forums :
    Inscription : Décembre 2010
    Messages : 15 191
    Billets dans le blog
    10
    Par défaut
    Essais ceci ===> loadhigh ou loadfix

    Cela fait un placement différent du programme en mode DOS.
    Vous pouvez utiliser les FAQ (ICI) ou les Tutoriels (ICI) et aussi accéder au blog (ICI)

Discussions similaires

  1. Comment exécuter automatiquement un script php toutes les 24h.
    Par legastu dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 2
    Dernier message: 12/06/2007, 15h25
  2. exécution d'un script php à heure fixe
    Par benkunz dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 3
    Dernier message: 02/04/2007, 18h29
  3. Réponses: 6
    Dernier message: 12/12/2006, 01h30
  4. [PHP-JS] Problème d'exécution d'un script php
    Par Yoteco dans le forum Langage
    Réponses: 1
    Dernier message: 06/10/2006, 14h19
  5. [Système] Exécution d'un script PHP à heures fixes
    Par Kiyomizu dans le forum Langage
    Réponses: 5
    Dernier message: 26/04/2006, 09h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo