Howto setup a MacBook for PHP development (part 3)
This article is a follow up on the second part of the 'How to setup a MacBook for PHP development` series.
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.
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'
of the context menu) or curl
$> curl http://pear.php.net/go-pear > go-pear.phpThen open the terminal and run it
$> sudo php go-pear.phpA 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-showIf everything is ok the configuration settings will be shown as in the example below:
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels auto_discover <not set>
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy <not set>
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config <not set>
PEAR executables directory bin_dir /usr/local/php5/bin
PEAR documentation directory doc_dir /usr/local/php5/lib/php/doc
PHP extension directory ext_dir /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613
PEAR directory php_dir /usr/local/php5/lib/php
PEAR Installer cache directory cache_dir /private/tmp/pear/cache
PEAR configuration file cfg_dir /usr/local/php5/lib/php/cfg
directory
PEAR data directory data_dir /usr/local/php5/lib/php/data
PEAR Installer download download_dir /private/tmp/pear/download
directory
PHP CLI/CGI binary php_bin /usr/local/php5/bin/php
php.ini location php_ini /usr/local/php5/lib/php.ini
--program-prefix passed to php_prefix <not set>
PHP's ./configure
--program-suffix passed to php_suffix <not set>
PHP's ./configure
PEAR Installer temp directory temp_dir /private/tmp/pear/temp
PEAR test directory test_dir /usr/local/php5/lib/php/test
PEAR www files directory www_dir /usr/local/php5/lib/php/htdocs
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 22
Debug Log Level verbose 1
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin /usr/local/bin/gpg
Signature Key Directory sig_keydir /usr/local/php5/etc/pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
User Configuration File Filename /Users/feder/.pearrc
System Configuration File Filename /usr/local/php5/etc/pear.conf
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/binUse the example above and
$> pear helpto 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.iniand 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!
!! 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
Fields with bold names are mandatory.