I have a multi part question for a php script file. I am creating this file that updates the database every second. There is no other modeling method, it has to be done every second.

Now i am running CentOS and i am new to it. The first noob question is:

> 
> How do i run a php file via SSH. I read it is just # php path-to/myfile.php. But i tried to echo something, and i dont see it in the text.
> 
> 
> 

Now i don't think that starting the file is going to be a problem. One problem i guess will be, i don't know if it is even possible, but here goes.

> 
> Is it possible for me to be hundred percent sure that the file is only run once. What happens if i by accident run the file again.
> 
> 
> 

I was wondering further, if i implement a write to a log every second, i can know if everything is running ok. If there is an error or something wrong the log file will stop.

> 
> Is the writing to a log file with the fopen, and write and close. Isn't this going to take a lot of time, isn't there an easier method in CentOS.
> 
> 
> 

Ok another big point i have is what happens when i run the file. Is the file run in the memory, or does it use the file in the system. Does it respond on changes made in the file, for example to stop the execution of the script.

> 
> Can i implement some kind of stop mechanism in the file itself. Or is there a command i can use to stop the file.
> 
> 
> 

Another option i know of is implementing a cronjob that runs every minute. And this cronjob executes the php file. The php file will loop for one minute, updateting everything needed, and terminating. I implemented this method, but just used a browser. I just browsed to mu file, and opened it. I saw the browser was busy for a minute, but it didn't update anything in the database. Does anyone have an idea what the reason of this can be.

Another question i have is by implementing the cronjob method, what is the command i fill in the PLESK panel. Is it the same as the above command. just php and the file name. Or are there special command like -f -q -something.

**Sorry for all the noob questions.**

If someone can help me i really appreciate it.

Ciao!