SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SSH Command Help

    Wonder if someone could point me in the right direction.
    I am trying to run a script from the command line, the file is located in public_html/xp/script.php
    The command I have attemted to use (as per instructions by the script maker) is as follows,

    php script.php -run public_html/xp

    but get the following message, "Could not open input file: script.php"

    I have checked the permissions of this file and that is not the issue. Am I using the right command to find the file?


    Thanks

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,326
    Mentioned
    191 Post(s)
    Tagged
    4 Thread(s)
    It appears you are running the command from a directory (folder) other than the location of the script.
    In order to run the script you must either a) be in the same directory or b) the directory in which the script lives is in your path.
    PHP is [probably] in your path. That is why you can issue the command from a prompt on your server.
    Try this
    PHP Code:
    php --run ~/public_html/xp/script.php 
    *notice the dash dash (two dashes) that are required when you use the full word. It would be a single dash and the letter 'r' otherwise
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help.
    I tried your command and got the following error message, "Parse error: syntax error, unexpected $end in Command line code on line 1"
    The directions from the script maker, albeit not very informative, are as follows,

    Run the script with a -run flag
    php '''regen-script.php''' -run <system path to '''regen-script.php folder'''>

    From the command promt I can get to the folder regen-script.php is in by using cd public_html/xp but once in that folder what command would I use then?

    Thanks

  4. #4
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,326
    Mentioned
    191 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Photo View Post
    From the command promt I can get to the folder regen-script.php is in by using cd public_html/xp but once in that folder what command would I use then?
    I have given you that answer as part of the explanation in my previous post. Assuming you are IN THE DIRECTORY where the script 'lives', simply use the self-reference syntax of DOT SLASH.
    This should work (making a few assumptions about the robustness of the script)
    PHP Code:
    php ./regen-script.php -run ./ 
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  5. #5
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you
    That did not work either so I am assuming there is an issue with the script. I will contact the script dev to take a look at it.


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
  •