Results 1 to 4 of 4

Thread: -bash: php: command not found

  1. #1
    Join Date
    Jul 2006
    Beans
    104

    -bash: php: command not found

    I have a script that I run from the command line on Centos simply by typing:
    php script.php

    When I tried this with Ubuntu I reveived:
    -bash: php: command not found

    I checked the php docs and it states to run php -v to check your version for the php CLI module:
    http://www.php.net/manual/en/features.commandline.php

    However event this doesn't work...
    I am guessing the php executable is not located in the path but have no idea how to rectify this...

    Thanks

  2. #2
    Join Date
    Jun 2006
    Location
    Ohio
    Beans
    2,370
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: -bash: php: command not found

    do you have the equivalent of php5-cli installed?

    sudo aptitude install php5-cli
    (Ubuntu 7.10) PC#1 SPECS / (Ubuntu 7.10) PC#2 SPECS / (Vista HomePremium | Arch Linux 2007.08-2) Gateway 6841
    VMs: Server 2k3, CentOS5 in Xen [mysql/apache/named], CentOS5 [zimbra server]

  3. #3
    Join Date
    Jul 2006
    Beans
    104

    Re: -bash: php: command not found

    Now I do...

    On Centos I didn't actually use a cli module the only diff I could see is that the std module output the headers however this was not a problem for me.

    now when I enter php -v I am presentled with:
    PHP 5.1.2 (cli) (built: Sep 6 2006 22:04:21)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

    Does this look right ?

    Thanks

  4. #4
    Join Date
    Jun 2006
    Location
    Ohio
    Beans
    2,370
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: -bash: php: command not found

    looks good to me, i haven't installed php5-cli this time (but i do use php for websites) so i can't check ... but if you can do $:> php myPHP.php and get output, you're all set
    (Ubuntu 7.10) PC#1 SPECS / (Ubuntu 7.10) PC#2 SPECS / (Vista HomePremium | Arch Linux 2007.08-2) Gateway 6841
    VMs: Server 2k3, CentOS5 in Xen [mysql/apache/named], CentOS5 [zimbra server]

Bookmarks

Posting Permissions

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