Bastian's Blog ~~~~~~~~~~~~~~ :Author: lapis :Date: Tue, 03 Nov 2009 12:15:48 +0100 :Revision: 11 :Copyright: CC by-nc-sa ==================================================== Howto setup a MacBook for PHP development (part 3) ==================================================== :Keywords: software, MacOsX, Apache, webserver, PHP, xDebug, command line interface :Description: :Abstract: Being the last episode of this tutorial for now, I will tell you about how to install and setup the PHP Extension Archive Repository (PEAR). The PEAR provides a lot of supportive modules thus as phpDocumentor and PHPUnit. This article is a follow up on the `second part`_ of the 'How to setup a MacBook for PHP development` series. .. _second part: 006_xDebug.html Installing the PHP Extension Archive Repository (PEAR) installer ================================================================ The PHP Extension Archive Repository (PEAR) is a huge resource of PHP extensions like phpDocumentor_ and PHPUnit_ to name those imho important for PHP development. .. _phpDocumentor: http://phpdoc.org .. _PHPUnit: http://phpunit.de To install PEAR just download the installation file from the PEAR webpage. You can either use the `go-pear.php`_ download link (use 'Save link as' .. _go-pear.php: http://pear.php.net/go-pear of the context menu) or curl :: $> curl http://pear.php.net/go-pear > go-pear.php Then open the terminal and run it :: $> sudo php go-pear.php A number of files will be downloaded and installed on your system. After the install script has done its' magic you should be able to list the properties of the recent installed PEAR by typing the following command into the terminal :: $> sudo pear config-show If everything is ok the configuration settings will be shown as in the example below: .. include:: examples/003_pear.conf :literal: It may happen that pear did not find your PHP installation so you need to configure it by yourself. Therefore PEAR has a number of commands e.g. :: $> sudo pear config-set bin_dir /usr/local/php5/bin Use the example above and :: $> pear help to configure your PEAR installation. Once your finished this there are a few adaptions to make on the php.ini. Open the php.ini file referred to in your PEAR configuration. :: $> sudo vim /usr/local/php5/lib/php.ini and add the install path of PEAR to the * php_include* path. This is necessary due to the fact that some PEAR packages depend on the pear install path being in the php_include path. The new entry should look like this: :: include_path=".:/usr/bin/pear" But please make sure you know what you are doing! .. danger:: **!! ATTENTION !!** If there are other pathes in this entry make sure you do not delete nor replace them by your changes. This might effect other installations or php scripts. Snow leopard ============ I was rather busy setting up my blog and fighting Mac OSX 10.5 to get the environment up and running. Meanwhile Apple set free 'Snow Leopard' to the wild. I did not get a hand on an upgrade to check this out, but it appears to me that most of the setup and install efforts are not necessary anymore. So if I get a hand on an upgrade, I will tell you about the preset environment, too. Trackbacks ========== Comments ========