TurnKey Linux Virtual Appliance Library

LAMP Appliance - PHP Command Line Not Found

Bo's picture
Obviously php works from calls through apache, since apache has been extended with php. However, we have php scripts designed to run as cron jobs, requiring command line execution. I did a server-wide find on php, php5, etc. with no luck locating it. I presume a simple install is required, but thought I would ask the forum for guidance before continuing with any apt-get's, yum's or whatever's... Caught me by surprise that a LAMP would not have command line php support out-of-the-box, and suggest this addition for future builds -- unless I am missing something... Thanks in advance for any help.
Jeremy's picture

Try this...

apt-get update
apt-get install php5-cli

If you are looking for other php (or other) stuff you can search from command line like this

apt-cache search php
Bo's picture

Simple. Works. Done.

Thanks.

Bo

Thanks! Just what I needed to know to move on...

Trying to get ZendFramework 2 tutorial app installed, trying to run first step: php composer.phar self-update and kept getting: -bash: php: command not found. Basic stuff, but I didn't know cli support had to be installed.

Thanks! 

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)