Tuesday, August 18, 2009

running php by command line

php 4.3.0 have CLI(command line interface) On by default. Today I am going to say about how to run php by command line in windows.

First of all you need to go to the php folder in your xampp by cmd. If you use svn, then you will have an error saying "Unable to load dynamic library 'E:/xampp/php/ext/php_svn.dll'- the specified module could not be found".

To solve this problem, you need to copy to following files from Apache/bin/ to php/ :


These will solve the above problem.

Now to execute a php file write the command: php address_of_the_file_to_run(for example E:/xampp/htdocs/tab.php)

you can pass arguments in the command line.And one the server side, you can fetch the argument by the $argv variable, the first element is always the filename that is executing.

List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

No comments: