When you overwrite a php file on a server (say, via SFTP) while it is being processed somewhere (perhaps it's a script that takes several seconds to compelete) does it cancel the currently running script or does that finish out even after the overwrite occurs? I suppose I'm asking: does apache load a php script into memory before executing it (and does it hold on to that in memory for the duration of execution)?
A PHP file is a plain text file, so you can open it in any text editor like VI, Notepad, or Sublime Text. For beginners, tools like Notepad++ should do, since they'll just be running small snippets of code.
That is, PHP is a server side language - it runs on the server and its interaction with the client is limited to sending it a web page.
If you started it in background use ps aux | grep time. php to get PID. Then just kill PID . If process started in foreground, use to interrupt it.
Whenever a PHP application rebuilds MySQL indexes, the process may run for a long time. Generally, allowing a PHP script to run forever is not desirable.
does apache load a php script into memory before executing it (and does it hold on to that in memory for the duration of execution)?
Yes.
Nothing at all. The script has already been loaded into memory in its compiled state - no matter how much time it takes, the web server won't load the new file unless you refresh the page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With