Save your fingers when using PHP-CLI

In Batch PHP I showed how to call PHP from a command line. For example, with Zend Server 6 or 7 on IBM i, one would launch a PASE command line using the command CALL QP2TERM, or launch QShell using QSH, then type a command such as this:

/usr/local/zendsvr6/bin/php-cli myscript.php

For those of us who use PHP-CLI often, the above command can be a finger-buster. Let’s shorten the path by creating a symbolic link:

cd /usr/bin
ln -s /usr/local/zendsvr6/bin/php-cli phpc

I created the symbolic link in /usr/bin, a directory that is likely to be in any user’s path.

Now try the shortened command:

phpc myscript.php

To test the shortcut without a PHP script, use the -v switch, which requests version information (‘v’ for version) about your PHP installation.

phpc -v

The above command will return version information that starts out something like this:

PHP 5.3.6 (cli) (built: Apr  7 2011 09:37:14)                                
Copyright (c) 1997-2011 The PHP Group                                        
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies                
    with Zend Extension Manager v5.1, Copyright (c) 2003-2010, by Zend Techno
logies                                                                       
    - with Zend Data Cache v4.0, Copyright (c) 2004-2010, by Zend Technologie
s [loaded] [licensed] [disabled]                                             
    - with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technolog
ies [loaded] [licensed] [enabled]                                            
    - with Zend Job Queue v4.0, Copyright (c) 2004-2010, by Zend Technologies
 [loaded] [not licensed] [disabled]

By creating a symbolic link to the PHP-CLI binary, practitioners of PHP can speed their work while saving their fingers.

For more about symbolic links, see my article Link up with QShell.

Brand your site with a favicon

Favicons are those eye-catching little pictures that appear in your web browser’s address bar, favorites list (hence the name favicon, short for “favorites icon”), and, with modern tabbed browsers, on tabs.

Instantly recognizable when designed well, favicons represent the brand identity of sites that use them.


Examples

Wikipedia uses the “W” from its logo:
Wikipedia’s favicon

Digg’s favicon represents a person holding a shovel, an image that seems to have been created especially for the favicon:
Digg’s favicon


Usability in a tabbed, multitasking world

Tabbed browsers, such as Firefox and Internet Explorer 7, can show many page-tabs at once, squishing a site’s descriptive text.
Below are examples of tabs without favicons. What sites are they? I don’t know.
FireFox tabs without favicons

These have favicons. At a glance I see a seated robed figure (meditation site), a stylized “Ti” that I recognize as my private TikiWiki site, and a picture of me, which (if I can stop admiring its beauty for a moment), I know represents my blog.
FireFox tabs with favicons


Create your own mini work of art

Favicons are ordinary graphics, generally 16×16 pixels in size, named favicon.ico. How to make them? I found an easy method that even non-artists can use.

The free site FavIcon from Pics allows anyone to convert a normal-sized graphic into a favicon. Instructions:

  1. Go to FavIcon from Pics.
  2. Click the “Browse…” button to select an image from your computer’s hard drive.
  3. Click “Generate FavIcon.ico.”
  4. After a few seconds, the site will show a preview image and a download link.
  5. If you are pleased with your creation, download favicon.ico to your computer. Then transfer that file, via FTP or your preferred method, to your website’s root folder (often /public_html or /www).
  6. View your website with its new addition! (You might have to press the refresh button to make the favicon appear.)


Show your art

If this article inspired you to create a favicon, please add a comment here with the link to your newly enhanced site.