Results 1 to 4 of 4

Thread: php question..

  1. #1
    Join Date
    Oct 2004
    Location
    Scotland
    Beans
    642
    Distro
    Ubuntu Development Release

    php question..

    I need to run a php script from the command line and want to be able to pass variables when calling the program... is this possible? Thanks for your time.

  2. #2
    Join Date
    Aug 2005
    Beans
    13
    Distro
    Edgy Eft Testing

    Re: php question..

    Install php4-cli/php5-cli (whatever matches the version of PHP you're using. I haven't tried php4 (because php5 is better ) but it should work the same) with synaptic/apt-get/whatever, and read this.

  3. #3
    Join Date
    Sep 2005
    Location
    UK
    Beans
    22
    Distro
    Ubuntu Breezy 5.10

    Re: php question..

    Once phpX-cli is install:

    Code:
    echo "<?php print_r($argv); ?>" > test.php
    Code:
    php -q test.php arg1 arg2 arg3

  4. #4
    Join Date
    Oct 2004
    Location
    Scotland
    Beans
    642
    Distro
    Ubuntu Development Release

    Re: php question..

    Thanks for the help guys... everything is working great!

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
  •