Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I run a php script from the command line?

Command line php run Script
0
Posted

How do I run a php script from the command line?

0

No matter what OS you have installed you need to compile / install php as a CGI because when you have php as a CGI you have a binary you can execute from anywhere like a command prompt. If you use a unix like OS you should do: /path/to/php -f /path/to/script.php For windows OS’s do: c:\path\to\php.exe -f c:\path\to\script.php The parameter -f is put on because we want to parse a file, the -f also implies -q which means you dont get any HTTP header output which in most cases is usefull when making command line scripts.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123