Guest Guest_Andrew Posted March 13, 2003 Posted March 13, 2003 heh nice faces Hello, I have a script in public_html directory, let's call it script.php, what command line should I write to execute it? i tried /public_html/script.php but it doesn't work Thanks for any help. Quote
Guest again me Posted March 13, 2003 Posted March 13, 2003 /bin/sh: public_html/skaiciai.php: Permission denied this is what i get.... Quote
KevinW Posted March 14, 2003 Posted March 14, 2003 is this php script designed for being run from a command prompt or from a web page? By default, you do not have access to a shell environment (command line prompt) with TCH. As far as running browser aware php scripts, simply upload it to your public_html directory, then run it from a browser. So, if it is script.php and it is sitting in your public_html directory, you would enter http://www.yoursite.com/script.php As a test, to prove to you that it works, go to the TCH Help Web Site, click on Tools and Scripts, and then download the zipped version of phpinfo.php. Unzip it (one file), and then FTP upload phpinfo.php to your public_html directory. You should then be able to run it from a browser, as: http://www.yoursite.com/phpinfo.php Hope this helps! kw Quote
Guest Guest_Andrew Posted March 14, 2003 Posted March 14, 2003 Hello, I guess You didn't understand me. I want to run a php script every hour using cron. ( system automatically runs my script every hour ). So i go to cPanel then to cron jobs. Then I set time, and don't know what to write in command line to run my script. Thank You. Quote
Ayman_ Posted March 14, 2003 Posted March 14, 2003 Cron, or Crontab as it is sometimes referred, is an application on the server that is used to automatically run programs. It is generally used for system backups but can be used for any job that needs to be scheduled. The Cron Tab feature in the Cpanel give you Web Access to the Cron program. It is a simple way to schedule scripts to run. You can schedule jobs my the hour, day, month and weekday. THIS FEATURE IS FOR ADVANCED USERS ONLY! DO NOT TO ABUSE this feature. In the event that TotalChoice determines that you are abusing the system from your use of this feature, your account could be suspended. If you know how to use Crontab, then you are quite aware of the drain that this feature can cause on server resources. Precautions that you should take are: Limit the number of processes that you run. Do not run processes every minute. Schedule your processes to run between midnight and 5:00 A.M. US Eastern Time. Limit the number of processes that you run. Do not run processes every minute. Schedule your processes to run between midnight and 5:00 A.M. US Central Time Here is a very good source on this - http://www.redhat.com/support/resources/ti.../cron/cron.html Warning: You need to have a good knowledge of Linux commands before you can use cron jobs effectively. There are many way to execute a php script. Take a look at the links I have provided they will guide you. Quote
Guest Guest_Andrew Posted March 14, 2003 Posted March 14, 2003 Thanks for the information. By the way, can I run a little script using Cron every hour. Will this be ok? Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.