我爱小甜饼's profile见字如面BlogLists Tools Help

Blog


    June 14

    修正从源码编译安装php-4.4.2的pear的错误

    文件名:修正从源码编译安装php-4.4.2的pear的错误
     
    影响范围:
    php-4.4.2
    php-4.4.3以后已经修复
     
    错误提示:
    alex@komodo:~/src$ pear
    Warning: main(Console/Getopt.php): failed to open stream: No such file or directory in System.php on line 27
    PHP Fatal error:  main(): Failed opening required 'Console/Getopt.php' (include_path='/home/alex/opt/php/lib/php') in /home/alex/opt/php/lib/php/System.php
     
    修正方法:
    1.下载http://pear.php.net/get/Console_Getopt-1.2.tar
    2.下载http://pear.php.net/get/Archive_Tar-1.3.1.tar
    3.确定PEAR.php的位置,例如
    alex@komodo:~$ slocate PEAR.php
    /home/alex/opt/php/lib/php/PEAR.php
    /home/alex/src/php-4.4.2/pear/PEAR.php
    alex@komodo:~$
    这里的/home/alex/opt/php/lib/php/PEAR.php是安装位置
    所以解压Console_Getopt-1.2.tar中的Console/Getopt.php,放到/home/alex/opt/php/lib/php/Console/Getopt.php
    解压Archive_Tar-1.3.1.tar中的Archive/Tar.php, 放到/home/alex/opt/php/lib/php/Archive/Tar.php
     
    4.升级PEAR以同步模块信息
    alex@komodo:~$ pear upgrade PEAR Console_Getopt Archive_Tar
    [完]