homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

How do you 'run a script' through putty?

 10:00 pm on Jan 30, 2007 (gmt 0)

I'm trying to upgrade some software on one of my sites and part of it has to be done through a command line - which I have very little experience with. The upgrade instructions say "From the command line, browse to the maintenance directory and run the update.php script".

I remembered how to use 'cd' and was able to find my way to the right place but I don't know how to run a script through a command line. I tried guessing with 'run update.php' - but I got an error, I think it was 'command not found'.

I did a search for putty commands but didn't see anything - I could have been looking in the wrong place.

What is the command and syntax to run a php script though a command line with putty?



 10:52 pm on Jan 30, 2007 (gmt 0)

All very close attempts but you were looking for the wrong command. To run a php script you need to invoke php, so you will need to learn about Using PHP from the command line [us2.php.net].

Navigate to the directory as you did before and run a php command:

php update.php

PuTTY itself is an SSH client. SSH is a secure shell (think of it like a Windows command line). You get a simple little interface with a command line to enter raw commands.


 11:08 pm on Jan 30, 2007 (gmt 0)

I get one problem solved and I just run into another!

I tried that and I get:

Sorry! This version requires php5; you are running 4.3.9.

If you are sure you already have php5 installed, it may be installed in a different path from php4. Check with you system administrator.

But I'm not - according to a page with 'phpinfo();' - its 5.2.0. Is it possible to do something like:

path/to/php5 update.php



 12:58 am on Jan 31, 2007 (gmt 0)

you could try something like
whereis php
whereis php5


 3:06 am on Jan 31, 2007 (gmt 0)

Sounds like your host has got two installations there and they are getting crossed-up because of misconfiguration or otherwise. The default executable for either version is php.exe. Time to consult the host to see what s/he has done.


 7:45 pm on Jan 31, 2007 (gmt 0)

thanks - I got it figured out now!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved