sneskid Posted April 14, 2006 Share Posted April 14, 2006 Do scripts that are already running have some sort of an internal ID that I can read?Can scripts that are running talk to eachother?In general, how hard is it to create a super global variable that all my scripts have access to and can manipulate?I know you can define super globals in the ini file... but in my case I have no access to it. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted April 14, 2006 Share Posted April 14, 2006 PHP is more or less runtime -- i don't believe it is designed to stay in memory and run forever. More info is needed to properly answer your question, but here are a few ideas:1. you could use sessions or cookies that each file can check -- this might be client global, but not really "global"2. you could use a mysql database or comma separated file to store variables that all of your separate files could read. I would think this could be considered "global" Quote Link to comment Share on other sites More sharing options...
sneskid Posted April 14, 2006 Author Share Posted April 14, 2006 I will be using a DB like that, haul variables from script to script. But I wanted to know my options... checking a global variable would cost alot less than a query.I've read articles where people run the PHP script as a "process". This was something they needed permission from their server host to do. If I run a PHP script in a loop that maybe indefinate... is it considered a process? Does a PHP script spawn a process?Do PHP scripts have a run-time limitation, maybe defined in the ini file?And a few quick questions:Can a script invoke another PHP script to run on it's own?Can the invoked script run without having a client to send data to? Basically be used to... say... manage database errors automatically or something. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted April 14, 2006 Share Posted April 14, 2006 PHP scripts are usually limited in your ini file to 30 or 60 seconds max execution time. You can have cron run a PHP script every minute if you want to. Check with your ISP (or in your control panel) to see if you can setup cron jobs. Quote Link to comment Share on other sites More sharing options...
sneskid Posted April 14, 2006 Author Share Posted April 14, 2006 What happens at the end of that time? Does execution just stop? The script could be doing something really critical...Can you explain what is meant by running a PHP script as a process? Cause a process can be indefinate.And one can always use set_time_limit(x)I found the cron job thing, it looks usefull. Quote Link to comment Share on other sites More sharing options...
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.