Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have shared hosting and they haven't given me command line (or ssh or shell) access. Is there a way that I can run something from the command line?

share|improve this question
2  
A lot of shared hosting providers include shell access. I would switch to one if possible. SSH is such a basic tool, it's going to better for you in the long run. –  Lèse majesté Dec 30 '12 at 3:01
add comment

2 Answers 2

cron is your best bet if you want to run something periodically.

If you just want to run a few shell commands (and depending on the security restrictions of your host) have a look at php's backtick operator and shell_exec function

I have had success with phpshell and phpsh projects too.

share|improve this answer
add comment

Your shared hosting may give you access to cron jobs. (On cPanel hosting this may be under Advanced Tools.) Cron is a Unix command which runs a task at a specified time. You can create a cron job to run the task you want, if your shared hosting lets you.

cPanel gives this warning though:

You need to have knowledge of *nix commands before you can use cron jobs effectively. Check your script with your hosting administrator before adding a cron job.

share|improve this answer
    
cPanel is not a console. –  toscho Oct 31 '12 at 3:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.