12 Useful PHP Commandline Usage Every Linux User Must Know

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

4 Responses

  1. MaQ says:


    I have an application that runs on localhost fine starting from terminal ex: ‘root@debian:/usr/local/lib/file# php -S localhost:8000’. I’m trying to get it to execute on boot and have no idea how to format for startup, it won’t execute in pm2, nor know how to add properly formated to rc.local, etc. I’ve looked for hours on end around net to no avail. Writing scripts is quite beyond my skill-set at this point. Most advice seems to center around either a complicated script or adding a simple command to cron, init.d or rc.local. I’m a cut and paste guy and usually need highly relevant concrete examples per instance. Any ideas?

    • Avishek Kumar says:

      Dear MaQ,
      As I am able to understand, you have an application that you want to start at boot automatically. You may run as root
      # update-rc.d Application_name defaults [Replace Application_name with the name of Application]

      To start something after reboot, open file /etc/crontab as root and enter the below line. Save and exit.

      @reboot /path/to/script

      Don’t forget to replace /path/to/script with original path.

      If you are unable to fix the issue yourself, you may forward me your SSH credentials with complete detail on OS and Application on my email id – avishek1210[at]gmail.com, for better assistance.

  2. Yoander says:

    Sometimes i used php -r to execute some simple php code for example simple php calculator php -r ‘echo 2**8+10;’

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?