Installer PHPDoc 2 sous Windows Seven

17 mai 2012 - 1071 mots - php

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
    1
    2
    3
    4
    5
    
    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
      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
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    
    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:
    <d:>
    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 <d:>? [
    Y/n] : Y
    
    php.ini <d:> 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.</d:></d:></d:>
    
  • 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
      1
      
      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
      1
      
      pear config-show
      
    • Au niveau de la ligne « PEAR documentation directory », il devrait y avoir « C:\php\pear\docs » ; il faut le changer
      1
      
      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
      1
      
      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

Finalement, on installe PHPDoc 2 :

  • On choisit le channel de PHPDoc :
    1
    2
    
    pear -C pear.ini channel-discover pear.phpdoc.org
    Channel "pear.phpdoc.org" is already initialized
    
  • On installe PHPDoc 2 (version alpha) :
    1
    2
    3
    4
    5
    6
    
    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.

Laisser un commentaire

Merci. Votre message a bien été enregistré.