Jump to content

Active PHP script identification


sneskid

Recommended Posts

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.
Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.