8

I'm having a look at some PayPal scripts/code examples and a lot of them need a php script running via the command line.

I've never had to run anything from a command line in PHP before so don't know where to start at all. I don't know if I'm using the correct search terms as Google hasn't helped me answer.

Do I need to use a different application or is there something in cPanel I can use?

I get this error:

INSTALLATION ERROR: Please cd to the /home/site_name/public_html/site and run install.php
penpen
  • 935
  • 3
  • 12
  • 22

2 Answers2

3

Use SSH to access the server via the terminal:

http://docs.cpanel.net/twiki/bin/view/11_30/CpanelDocs/ShellAccess

There's instructions on how to connect via PuTTY, then you can go to the directory where the PHP script is run it like:

php myPHPScript.php

Doug Molineux
  • 12,283
  • 25
  • 92
  • 144
  • So I need to download "PuTTY" (from here http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) and then connect to my hosting and go from there? – penpen Apr 26 '12 at 18:51
  • 1
    Yes, that sounds about right, executing php from the command line is pretty simply, the hardest part will be configuring putty to actually logging in :) – Doug Molineux Apr 26 '12 at 21:17
  • 1
    You were right, it's been a bit of an ordeal but thanks for getting me started! This little guide is quite handy for where to get started messing around with keys: http://support.hostgator.com/articles/specialized-help/technical/ssh-keying-through-putty-on-windows-or-linux – penpen Apr 27 '12 at 20:41
  • 1
    Thank you, there just doesn't seem to be any resources/tutorials for complete beginners who don't even know what the correct terms or programs to use are so you've been very helpful :) – penpen Apr 27 '12 at 22:39
  • 3
    The link is now broken :( – Cliff Burton Apr 14 '17 at 09:40
  • Please either update link or remove it (it's broken) – Sebastialonso Apr 06 '18 at 14:28
0

If your cPanel has the option to turn on SSH, do it. Then SSH into the server and run the commands -

cd /home/site_name/public_html/site
php install.php
Bibhas Debnath
  • 14,559
  • 17
  • 68
  • 96