LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-27-2006, 05:23 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
cronjob php script


i have a php script that needs to be run once every 24 hours. i know how to create cronjob scrpits. but how do i do it for a php file? because normaly dont you need php files to be accesed through the webserver(apache) for them to run?

btw the file is located in a directory not online. and id like to keep it that way if possible just for general security reasons.
 
Old 08-27-2006, 07:30 PM   #2
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Quote:
Originally Posted by MrSako
because normaly dont you need php files to be accesed through the webserver(apache) for them to run?
Not necessarily. Many PHP scripts do need to be run by the web server, but it depends on the details of the script.

If you have the command-line PHP interpreter installed (it may or may not be packaged with the Apache module), then you can run a script from the command line like this:
Code:
php /path/to/yourscript.php
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Title: PHP/MySQL Classifieds Script AddAsset1.php Script Insertion LXer Syndicated Linux News 0 07-02-2006 06:21 PM
issues with mirc script accessing our php script dtra Linux - Software 2 07-02-2005 04:30 PM
cronjob not working but script works dtra Linux - Newbie 4 02-28-2005 05:05 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
converting shell script to php script ? ibro Linux - General 6 05-24-2004 05:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration