How to install PHP Unix man pages in Linux?

Posted by Joys of Programming on in PHP

Are you surprised by seeing the title of this post? Is it really possible to get PHP man pages locally in your machine? Quite often we refer the PHP manual for knowing more about a php function. If this information is available locally, it will really be helpful for a quick reference and also when you are not connected on internet.

PHP Unix man pages is available as a PEAR package. So to install PHP Unix man pages, follow the following steps

  1. Install PHP-pear.
  2. Now install the PHP man pages using pear

$ sudo pear install doc.php.net/pman
downloading pman-2010.04.28.tgz ...
Starting to download pman-2010.04.28.tgz (4,839,774 bytes)
......................................................done: 4,839,774 bytes
install ok: channel://doc.php.net/pman-2010.04.28

The manual pages are now available locally. Now let’s access some of them.
Syntax

$ pman function_name

Note, it’s not man but pman.
Example:

$ pman file_get_contents
FILE_GET_CONTENTS(3)                                                             PHP Manual                                                             FILE_GET_CONTENTS(3)

SYNOPSIS
       string file_get_contents (string $filename, [int $flags], [resource $context], [int $offset = -1], [int $maxlen = -1])

        This function is similar to file(3), except that file_get_contents(3) returns the file in a
       string, starting at the specified $offset up to $maxlen bytes. On failure, file_get_contents(3) will return FALSE.

       file_get_contents(3) is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance per‐
       formance.
......


Tags: , , , ,

Comments:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.