Results 1 to 4 of 4

Thread: Where can I find the PHP5 CLI (command line interface)?

  1. #1
    Administrator Kavoir's Avatar
    Join Date
    Dec 2009
    Posts
    183

    Where can I find the PHP5 CLI (command line interface)?

    First you have to make sure you have installed it. It isn't uncommon that one forgets or simply doesn't know that the PHP CLI has to be explicitly installed or it won't be available even if you can run php code on your website, especially on an unmanaged VPS.

    To install PHP CLI, go through:

    Code:
    aptitude install php5-cli
    This is on Debian Lenny. Depending on your own Linux distribution, you may use apt-get or yum instead. Now you can issue command line commands via SSH. Most likely, your PHP command line interpreter should be located at /usr/bin/php5, otherwise, run whereis to see where it is so you can run php code from Linux command line:

    Code:
    whereis php5

  2. #2
    Administrator Kavoir's Avatar
    Join Date
    Dec 2009
    Posts
    183
    So after this, you can run PHP scripts from Linux command line in this manner:

    Code:
    /user/bin/php5 /path/to/your/script.php

  3. #3
    Administrator Kavoir's Avatar
    Join Date
    Dec 2009
    Posts
    183
    There are a great diversity of programming languages to program Linux system, once you have learnt PHP well, not only can you write interactive web pages but you can also write scripts that are run in the background to take care of your server. For instance, you can write a PHP script and schedule its running with crontab jobs to clean up temporary files.

  4. #4
    Nice postings by Kavoir.
    Really great.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •