Getting and installing the PEAR package manager

Getting and installing the PEAR package manager

Windows

After you have downloaded and installed PHP, you have to manually execute the batch file located in e.g.c:\php\go-pear.bat. The setup will ask you some questions and afterwards the PEAR Package Manager will be installed in the path, which you have specified during installation.

Finally you have to add that installation path to your PATH environment. Either do this manually (Start > Control Panel > System > Environment) or run (double-click) the newly generatedPEAR_ENV.reg that's now found in the PHP source directory.

After that you can access the PEAR Package Manager by running the commandpear in a Windows Command Prompt.

To update your PEAR installation, request http://pear.php.net/go-pear.phar in your browser and save the output to a local filego-pear.phar. You can then run

      
php go-pear.phar
      
     

in a Windows Command Prompt to start the update process.

After changing php.ini , you need to restart your web server.

Now check that PEAR works.

Unix/Linux/BSD

When using PHP, the PEAR Package Manager is already installed unless one has used the./configure option --without-pear.

If one uses a version of PHP that is supplied by Unix/Linux/BSD distributors it may be necessary to manually install PEAR. Users should consult the documentation for the respective distribution in this case.

If you want to re-install the Package Manager, you can use the following provisional way:

      
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar
      
     

If the process just exits without any output, your syslog will probably contain the following lines:

suhosin[4705]: ALERT - Include filename ('phar://go-pear.phar/index.php')
 is an URL that is not allowed
 (attacker 'REMOTE_ADDR not set', file '/root/go-pear.phar', line 1236)
     

To work around this problem, enable the phar in /etc/php5/conf.d/suhosin.ini:

suhosin.executor.include.whitelist = phar
     

Now check that PEAR works.

Mac OS X

On Mac OS 10.4 and earlier, the PEAR Package Manager is already installed in/usr/bin/pear.

If you are using Mac OS 10.5 (Leopard), would like to install a new copy, or re-install the PEAR Package Manager use the following command:

      
$ wget http://pear.php.net/go-pear.phar
$ php -d detect_unicode=0 go-pear.phar
      
     

For a system-wide installation, you will need to execute the go-pear script with increased permissions. This is only recommended for advanced users.

       
$ wget http://pear.php.net/go-pear.phar
$ sudo php -d detect_unicode=0 go-pear.phar
       
      

Now check that PEAR works.

PEAR in hosting environments

If you are running your site at a web hosting provider with no direct access to the server (via local logins, Telnet or SSH), you can use the PEAR Installer using the Web Frontend or(S)FTP.

Go to go-pear and save as go-pear.php. Copy go-pear.php to your server and open the corresponding URL in your browser, for examplehttp://example.com/pear/go-pear.php.

Do not forget to protect the pear directory if you did not do already before the installation: Make it unreadable and not executable from external (i.e. put it outsidepublic_html).

Now check that PEAR works.


FROM : http://pear.php.net/manual/en/installation.getting.php

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值