Is there a way to stop the script? I host shared hosting, so I donโt have access to the command line, and I donโt know the PID.
Then no.
But are you sure you donโt have access to the shell? Even through PHP? If you do, you can try ...
<?php print `ps -ef | grep php`;
... and if you can determine the process from this, then ....
<?php $pid=12345; // for example. print `kill -9 $pid`;
And even if you don't have access to shell command launches, you can find the pid in / proc (on a Linux system) and terminate it using the POSIX extension ....
<?php $ps=glob('/proc/[0-9]*'); foreach ($ps as $p) { if (is_dir($p) && is_writeable($p)) { print "proc= " . basename($p); $cmd=file_get_contents($p . '/cmdline'); print " / " . file_get_contents($p . '/cmdline'); if (preg_match('/(php).*(myscript.php)/',$cmd)) { posix_kill(basename($p), SIGKILL); print " xxxxx...."; break; } print "\n"; } }
source share