Pear 安装注意事项

Verifying the include path

To use PEAR and PEAR compatible packages in your applications, you normally include them into your PHP scripts using require_once(). For this to work, PEAR'sphp_dir must be a part of PHP's include path.

  1. First, check where PEAR installs .php files:

    $ pear config-get php_dir
    /usr/share/lib/php/

    This directory will contain System.php.

  2. Now it's time to find which configuration file is used by your PHP installation. On command line, execute:

    $ php --ini
    Configuration File (php.ini) Path: /etc/php/cli-php5
    Loaded Configuration File:         /etc/php/cli-php5/php.ini
    Scan for additional .ini files in: /etc/php/cli-php5/ext-active
    Additional .ini files parsed:      /etc/php/cli-php5/ext-active/php_gtk2.ini,
    /etc/php/cli-php5/ext-active/xdebug.ini

    To see which php.ini is used by PHP on your web server, create a file with only <?php phpinfo(); ?> as the contents, and save it in your local web root ascheck_php.php. Open the file in your browser as http://localhost/check_php.php, to find the path to the php.ini file your web server is using.

  3. Now check PHP's include_path setting on command line:

    $ php -c /path/to/php.ini -r 'echo get_include_path()."\n";'

    To check PHP's include_path in your web server, create a file with only <?php phpinfo(); ?> as the contents, and save it in your local web root as check_php.php. Open the file in your browser as http://localhost/check_php.php, to verify the include_path your web server is using.

    In every case, PEAR's php_dir should be in the include path. If not, add it in your system's php.ini.


    这里特别要注意,如果你用的wamp,实际在起作用的php.ini并不是在php文件夹下,而是在apache里

    ;***** Added by go-pear
    include_path=".;C:\Users\lein\pear"
    ;*****




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值