Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can I execute a PHP script using command line?

Answer Posted / indra

By using CLI ( command line interface)

On command prompt type : php filename

Example:
Php –r ‘print_r(get_defined_constanrs());’

From a shell, php –v will display whether the SAPI is CLI or CGI

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a table to store files?

1010


Explain Type hinting in PHP?

977


How do I escape data before storing it in the database?

941


What are the functions to be used to get the image's properties (size, width and height)?

937


How to get the number of characters in a string?

974


What is namespace and use in php?

933


What is use of header() function in php?

980


Can you specify the "new line" character in single-quoted strings?

907


What is the default session time in php?

959


Explain scalar type declarations in php7?

910


How to set session.gc_maxlifetime properly?

1005


What is the best php version for wordpress?

1023


How to Retrieve the Session ID of the Current Session?

925


How many types of php are there?

929


Is php harder than javascript?

950