Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Section A.4. Installing Extensions

A.4. Installing Extensions

So installing PEAR packages is easy, but what about extensions? Mostly, just as easy:

$ pear install xdebug
No releases available for package "pear.php.net/xdebug" - 
package pecl/xdebug can be installed with "pecl install xdebug"
install failed

Trying to use the pear command fails, however; this is because we must use the pecl command instead. This command is functionally identical to the pear command in almost every way:
$ pecl install xhprof
downloading xhprof-0.9.2.tgz ...
Starting to download xhprof-0.9.2.tgz (931,660 bytes)
...........................................................
...........................................................
...done: 931,660 bytes
11 source files, building
running: phpize
Configuring for:

⋮

As you can see, this grabs the PECL package, and starts to compile it for you. Once the compilation is done, you’ll see a message like this:
Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20090626/➥
  xhprof.so'
install ok: channel://pecl.php.net/xhprof-0.9.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=xhprof.so" to php.ini

This indicates that the extension itself was installed to the directory (on our system, this may differ on yours): /usr/lib/php/extensions/no-debug-non-zts-20090626. This is the directory that should be set as the extension_dir in your php.ini.

Should you see the last two lines, and you want the pecl command to automatically update your php.ini file with the required extension= line, you can tell it the location of your php.ini file by running:

$ pecl config-set php_ini /path/to/php.ini
config-set succeeded


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint