Welcome to WebmasterWorld Guest from 107.20.34.173

Forum Moderators: bakedjake

Message Too Old, No Replies

How do you 'run a script' through putty?

     

Trisha

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

10+ Year Member



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?

coopster

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

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

Trisha

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

10+ Year Member



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

?

phranque

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

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



you could try something like
whereis php
or
whereis php5

coopster

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

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

Trisha

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

10+ Year Member



thanks - I got it figured out now!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month