Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts

    How to run a script from SSH

    How do I run a php script from the SSH command line?

    I'm doing this: php test.php

    I can run my script ok from the brower but when I try to execute it in SSH at the command line, the cmd prompt never returns.

    Is there some kind of trick?
    Last edited by rfresh; 03-11-2008 at 04:14 PM.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #2
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts
    Make sure you are permitted to execute script.

  • #3
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    you may have to install PHPRC in order to execute scripts from the shell.

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by cancer10 View Post
    Make sure you are permitted to execute script.
    I am susposed to be able to execute - I am logging in as root.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by rfresh View Post
    I am susposed to be able to execute - I am logging in as root.
    Since you say you are logged in as root is it safe to assume you are the administrator of the system? If so then did you install configure PHP for running PHP from the command line?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #6
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts
    If you do not get "command not found" php is installed to run CLI so it might be something wrong with the script or your php install maybe fubar. What is in the test.php?


  •  

    Posting Permissions

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