Jump to content

Recommended Posts

Hi,

 

I am new to this forums and php. I have a php script that needs monitoring of one of its feature. This monitoring can be done by PIDs? My programmer said - 'we can monitor the script by getting PIDs (either from posix or shell, i don't know wha these means...) from server so we can know the script running that particular feature'. Can these getting PIDs allowed by hosts? not a security risk to script?

 

Using PIDs is common among php coders?

 

I don't know coding. So asking your opinions please.

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/51176-question-about-pids-please-help/
Share on other sites

PID's? To me PID means either "Process ID" or "Page ID" and ID's for pages are very common:

 

index.php?pid=contact, index.php?pid=home

 

and I don't think that's what you mean, so I think you have to explain more about what you wanna use them for. The monitoring thing

PID means (atleast in my concern) are Process IDs. System gives a number to each process?

 

The feature is: the script creates certain webpages in my area at certain interval and delete them after certain interval. So to stop script to create second set of pages while there are first set of pages, it needs some checking. right? So PIDs are advisable to use php scripts?

 

Thanks Wuhtzu!

Well if PID means Process ID I don't see how you intend to use with PHP. Process ID's do not exist for a php-script since they aren't processes and a PHP script can't run it self at a specific time. It needs to be requested by a user or a task manager like cron.

 

So lets say you have "createwebpage.php" and "deletehomepage.php" you can set a task manager each script with a specific time interval.

 

You have to explain your self in more detail and maybe present some code

 

Wuhtzu

Okay, then I can't answer your question. I don't what you would use them for... certainly not monitor anything that has to do with the script. You could monitor some other software to check if its running or so...

 

Look at

 

http://no2.php.net/manual/en/function.proc-get-status.php

http://no2.php.net/manual/en/function.proc-open.php

 

Good luck

Wuhtzu

Your really not being clear with the description of your problem. Are these php scripts being run through a server or are they standalone scripts? If the later, yes its possible to get the PID of each script. Otherwise, your PID's are going to be child processes of the server, and allot more difficult to track down.

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.