The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

New Linux User

Discussion in 'General Discussion' started by atlanta1, May 16, 2006.

  1. atlanta1

    atlanta1 Registered

    Joined:
    May 16, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi everyone!

    I want to know how to upload a .php file to the root folder of my server and then what is the entry to run that file.

    It maybe easy - maybe impossible - but I'm a total linux idiot - so any help would be greatly appreciated.

    Thank You
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    You can upload any file to any location on your server using FTP, however it is not recommended as it is not secure and therefore someone could intercept your root password.

    A better method would be SCP or SFTP. Both essentiall offer a secure form of FTP. Track yourself down a copy of WinSCP. It's a very nice SCP client that lets you operate with files much in the same way as you would with an FTP client, although it's a Windows-only program.

    As for executing the script, that's a quite different question.

    If you have the shebang line in place, you can execute it from root SSH by simply entering the name of the script, for example:

    script.php
    /path/to/script.php

    in fact in such situations, the .php extension is not needed.

    On the other hand, if you want to access your PHP script via a browser you're going to have to do a lot more.

    You'd be hard pressed to simply go to http://example.com/root/script.php to get it to execute, in fact that would by no means work.

    However you can use the Remote Access features provided by WHM/cPanel to safely get a script to pass a request back to a root-executable script and then get back the output from the root-executable script and use it in your normal script. I've posted a tutorial covering how this can be achieved at http://forums.cpanel.net/showthread.php?t=46362
     
  3. atlanta1

    atlanta1 Registered

    Joined:
    May 16, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks webigition

    I downloaded a copy of WinSCP - copy the file to root - and it works

    Thank You
     
Loading...

Share This Page