Installer PHPDoc 2 sous Windows Seven

L’installation de PHPDoc 2 se fera en deux étapes :

  • Installation de PEAR dans WAMP
  • Installation de PHPDoc


Tout d’abord, on installe PEAR :

  • Aller dans le dossier de PHP de WAMP (D:\\Programmes\\wamp\\bin\\php\\php5.3.8)
  • Télécharger le fichier http://pear.php.net/go-pear.phar
  • Ouvrir une invite de commandes
  • Aller dans le dossier PHP de WAMP
    C:\\Users\\Franklin>d:
    
    D:\\>cd Programmes\\wamp\\bin\\php\\php5.3.8
    
    D:\\Programmes\\wamp\\bin\\php\\php5.3.8>
  • Lancer l’appel de Go-PEAR
    D:\\Programmes\\wamp\\bin\\php\\php5.3.8>php go-pear.phar
    
    Are you installing a system-wide PEAR or a local copy?
    (system|local) [system] : system
    
    Below is a suggested file layout for your new PEAR installation.  To
    change individual locations, type the number in front of the
    directory.  Type 'all' to change all of them or simply press Enter to
    accept these locations.
    
     1. Installation base ($prefix)                   : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8
     2. Temporary directory for processing            : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\tmp
     3. Temporary directory for downloads             : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\tmp
     4. Binaries directory                            : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8
     5. PHP code directory ($php_dir)                 : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\pear
     6. Documentation directory                       : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\docs
     7. Data directory                                : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\data
     8. User-modifiable configuration files directory : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\cfg
     9. Public Web Files directory                    : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\www
    10. Tests directory                               : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\tests
    11. Name of configuration file                    : C:\\Windows\\pear.ini
    12. Path to CLI php.exe                           : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8
    
    1-12, 'all' or Enter to continue: 11
    (Use $prefix as a shortcut for 'D:\\Programmes\\wamp\\bin\\php\\php5.3.8', etc.)
    Name of configuration file [C:\\Windows\\pear.ini] : $prefix\\pear.ini
    
    
    Below is a suggested file layout for your new PEAR installation.  To
    change individual locations, type the number in front of the
    directory.  Type 'all' to change all of them or simply press Enter to
    accept these locations.
    
     1. Installation base ($prefix)                   : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8
     2. Temporary directory for processing            : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\tmp
     3. Temporary directory for downloads             : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\tmp
     4. Binaries directory                            : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8
     5. PHP code directory ($php_dir)                 : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\pear
     6. Documentation directory                       : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\docs
     7. Data directory                                : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\data
     8. User-modifiable configuration files directory : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\cfg
     9. Public Web Files directory                    : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\www
    10. Tests directory                               : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\tests
    11. Name of configuration file                    : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8\\pear.ini
    12. Path to CLI php.exe                           : D:\\Programmes\\wamp\\bin\\php\\p
    hp5.3.8
    
    1-12, 'all' or Enter to continue:
    Beginning install...
    Configuration written to D:\\Programmes\\wamp\\bin\\php\\php5.3.8\\pear.ini...
    Initialized registry...
    Preparing to install...
    installing phar://D:/Programmes/wamp/bin/php/php5.3.8/go-pear.phar/PEAR/go-pear-
    tarballs/Archive_Tar-1.3.7.tar...
    installing phar://D:/Programmes/wamp/bin/php/php5.3.8/go-pear.phar/PEAR/go-pear-
    tarballs/Console_Getopt-1.3.0.tar...
    installing phar://D:/Programmes/wamp/bin/php/php5.3.8/go-pear.phar/PEAR/go-pear-
    tarballs/PEAR-1.9.4.tar...
    installing phar://D:/Programmes/wamp/bin/php/php5.3.8/go-pear.phar/PEAR/go-pear-
    tarballs/Structures_Graph-1.0.4.tar...
    installing phar://D:/Programmes/wamp/bin/php/php5.3.8/go-pear.phar/PEAR/go-pear-
    tarballs/XML_Util-1.2.1.tar...
    install ok: channel://pear.php.net/Archive_Tar-1.3.7
    install ok: channel://pear.php.net/Console_Getopt-1.3.0
    install ok: channel://pear.php.net/Structures_Graph-1.0.4
    install ok: channel://pear.php.net/XML_Util-1.2.1
    install ok: channel://pear.php.net/PEAR-1.9.4
    PEAR: Optional feature webinstaller available (PEAR's web-based installer)
    PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
    PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
    
    PEAR: To install optional features use "pear install pear/PEAR#featurename"
    
    ******************************************************************************
    WARNING!  The include_path defined in the currently used php.ini does not
    contain the PEAR PHP directory you just specified:
    
    If the specified directory is also not in the include_path used by
    your scripts, you will have problems getting any PEAR packages working.
    
    Would you like to alter php.ini ? [
    Y/n] : Y
    
    php.ini  include_path updated.
    
    Current include path           : .;C:\\php\\pear
    Configured directory           : D:\\Programmes\\wamp\\bin\\php\\php5.3.8\\pear
    Currently used php.ini (guess) : D:\\Programmes\\wamp\\bin\\php\\php5.3.8\\php.ini
    Press Enter to continue:
    
    ** WARNING! Old version found at D:\\Programmes\\wamp\\bin\\php\\php5.3.8, please rem
    ove it or be sure to use the new d:\\programmes\\wamp\\bin\\php\\php5.3.8\\pear.bat co
    mmand
    
    The 'pear' command is now at your service at d:\\programmes\\wamp\\bin\\php\\php5.3.8
    \\pear.bat
    
    ** The 'pear' command is not currently in your PATH, so you need to
    ** use 'd:\\programmes\\wamp\\bin\\php\\php5.3.8\\pear.bat' until you have added
    ** 'D:\\Programmes\\wamp\\bin\\php\\php5.3.8' to your PATH environment variable.
    
    Run it without parameters to see the available actions, try 'pear list'
    to see what packages are installed, or 'pear help' for help.
    
    For more information about PEAR, see:
    
      http://pear.php.net/faq.php
      http://pear.php.net/manual/
    
    Thanks for using go-pear!
    
    
    
    * WINDOWS ENVIRONMENT VARIABLES *
    For convenience, a REG file is available under D:\\Programmes\\wamp\\bin\\php\\php5.3
    .8PEAR_ENV.reg .
    This file creates ENV variables for the current user.
    
    Double-click this file to add it to the current user registry.
  • Doucle cliquer sur “PEAR_ENV.reg” pour enregister les paths dans le registre de Windows
  • Pour tester si PEAR est fonctionnel, un simple PEAR dans une invite de commandes devrait vous retourner l’aide
  • Redémarrer votre ordinateur avant de continuer pour que les variables d’environnement soient correctement déclarés
  • Ensuite, on met à jour PEAR :
    • On lance la mise à jour via invite de commandes
      pear upgrade-all
    • Un erreur peut arriver de ce type :
      ERROR: failed to mkdir C:\\php\\pear\\docs\\Archive_Tar\\docs
    • On regarde la config
      pear config-show
    • Au niveau de la ligne “PEAR documentation directory”, il devrait y avoir “C:\\php\\pear\\docs” ; il faut le changer
      pear -C "D:\\Programmes\\wamp\\bin\\php\\php5.3.8\\pear.ini" config-set doc_dir "D:\\Programmes\\wamp\\bin\\php\\php5.3.8\\pear-doc" system
    • En fait, pour l’utilisation de PEAR, il faut préciser le fichier de configuration
      pear -C pear.ini upgrade-all

Ensuite, on configure PHP dans WAMP via le PHP.INI:

  • activation de php_fileinfo et php_xsl
  • définition de memory_limit à 512M qui est par défaut à 128M (dans le cas de PHPExcel)

Il manque une pré-requis pour PHPDoc 2 afin d’afficher les graphiques : Graphviz

  • télécharger le package Windows : http://www.graphviz.org/Download_windows.php
  • vérifier que la commande “dot” fonctionne dans une invite de commandes

Finalement, on installe PHPDoc 2 :

  • On choisit le channel de PHPDoc :
    pear -C pear.ini channel-discover pear.phpdoc.org
    Channel "pear.phpdoc.org" is already initialized
  • On installe PHPDoc 2 (version alpha) :
    pear -C pear.ini install phpdoc/phpDocumentor-alpha
    Did not download optional dependencies: pear/PEAR_PackageFileManager2, use --alldeps to download automatically
    phpdoc/phpDocumentor can optionally use package "pear/PEAR_PackageFileManager2"(version >= 1.0.2) downloading phpDocumentor-2.0.0a3.tgz ...
    Starting to download phpDocumentor-2.0.0a3.tgz (2,317,377 bytes)
    ...................................................................................................................................done: 2,317,377 bytes
    install ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a3
  • Pour tester si PHPDoc2 est fonctionnel, un simple phpdoc dans une invite de commandes devrait vous retourner l’aide.

Cet article Installer PHPDoc 2 sous Windows Seven est apparu en premier sur RootsLabs.

Vus : 858
Publié par Progi1984 : 78