Installing PHP for command line
 ¿Qui © is PHP CLI?
PHP CLI is a PHP interface for short command line. As its name implies, this is a way to use PHP on the command line system. In other words, is a way to run PHP scripts that are not on a web server (like Apache or IIS Web server from Microsoft).
The people speak and think in PHP web development, see PHP as a server-side tool. However, PHP CLI applies all the benefits of PHP scripts which allow shell scripts to create server-side services or applications to GUI system.
PHP CLI is available for all operating systems: Linux, Windows, OSX, Solaris.
 © Why use PHP CLI chemical?
You want to use PHP CLI SAPI Just because there are several advantages in being able to execute PHP code from the command line like:
- No need to learn another language development, such as Perl, Bash or Awk
- Schedule and run tasks from cron written in php
- Making GUI applications with PHP and GTK
- Reuse existing components
- Write robust scripts or scripts for your system using the multithread capability PHP5
- Access to STDIN, STDOUT, STERRAD operating system with PHP
The popular Linux distributions (like Ubuntu, Debian, Fedora, Suse, etc) allow you to install PHP CLI from the package manager (eg Synaptic or similar) with a few mouse clicks. This makes trouble-free installation and you can start using in a second!
If you have a standard installation of PHP for the Apache Web server, then there is high probability that you already have PHP CLI installed. The possibilities are even greater if your system is running Linux.
Otherwise, some scrip to want to run PHP from the command line, Linux will show this error:
fher98 @ deathbian: ~ $ php / usr / bin / env: php: No such file or directory
Even in facilities 5.2.x the only Php Php files in /usr/bin are /usr/bin/php-cgi y /usr/bin/php5-cgi For I may not run their PHP from the console. To resolve this can create a symbolic link in / usr / bin / from php to php5-cgi. After running the command which php show them where is the php command.
Installing PHP CLI on Debian / Ubuntu
If you followed the installation guide for Apache / PHP and now want to run PHP pages from the command line is necessary to make the installation of the PHP CLI.
deathbian: ~ # apt-get install php4-cli Or deathbian: ~ # apt-get install php5-cli
To check that our installation was successful, type:
fher98 @ deathbian: ~ $ php-v PHP 5.1.6 (cli) (built: Jul 16 2008 19:53:00) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies






























ACTIVATE PHP
estimated
I have this warning! Please can you help me solve this problem
root @ you: / # php5-v
PHP Warning: PHP Startup: Unable to load dynamic library '/ usr/lib/php5/20060613 + lfs / php_mapscript.so' - / usr/lib/php5/20060613 + lfs / php_mapscript.so: shared object can not open file: No such file or directory in Unknown on line 0
LibClamAV Warning: *********************************************** ************
LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***
LibClamAV Warning: *** DO NOT PANIC! Read http://www.clamav.net/support/faq ***
LibClamAV Warning: *********************************************** ************
LibClamAV Warning: *********************************************** ************
LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***
LibClamAV Warning: *** DO NOT PANIC! Read http://www.clamav.net/support/faq ***
LibClamAV Warning: *********************************************** ************
PHP Warning: Can not load module 'pdo_dblib' because required module 'pdo' is not loaded in Unknown on line 0
PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009 19:52:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans
This is the version of the ClamAV engine is outdated is because the clamav antivirus must be updated.
My I get this error:
Fatal error: Call to undefined function dl () in / usr/local/apache2/htdocs/index1.php on line 4
May signal that it is due this error???
Thanks
This error indicates that you are calling the function in line 4 does not exist.
Thanks for answer .... Actually I'm trying to install mapserver with support for PHPMapscript and when loading the extension php_mapscript.so is where the problem occurs to me ...
When I create a php file with the following contents:
I return all the information about php.
The problem arises when I load the library php_mapscript.so. For this I make a php file with the following code:
And that's when the browser returns me the following error:
Fatal error: Call to undefined function dl () in / usr/local/apache2/htdocs/index1.php on line 2
Thanks again for your help