---
title: "How can I execute a PHP script using command line?"  
description: "How can I execute a PHP script using command line?"  
author: "Anonymous User"  
published: 2011-03-18  
updated: 2020-09-20  
canonical: https://www.mindstick.com/interview/477/how-can-i-execute-a-php-script-using-command-line  
category: "php"  
tags: ["php"]  
reading_time: 1 minute  

---

# How can I execute a PHP script using command line?

Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "php myScript.php", assuming "php" is the command to invoke the CLI program. \

## Answers

### Answer by Anonymous User

Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "php myScript.php", assuming "php" is the command to invoke the CLI program. \


---

Original Source: https://www.mindstick.com/interview/477/how-can-i-execute-a-php-script-using-command-line

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
