Answer the question
In order to leave comments, you need to log in
How to run one file from another?
There are two files, you just need to run the other from one so that it also works, but not include, not in this file.
ps
I'm not strong in php, so maybe a stupid question, I have a php file, it performs some actions writes data to the session, another file is in a different place, which should record from this session, at the same moment, move them no, there is no possibility to execute one in the other, include is not suitable, the other has no rights in this section. Is there any easy way to run one file from another?
Answer the question
In order to leave comments, you need to log in
shell_exec + su/sudo + /usr/bin/php /path/to/script.php
?
Can do
file_get_contents('http://yoursite.loc/yourscript.php');
//тут нужно вписать адрес, по которому находится желаемый скрипт
At the end of the first script put header("Location: let_before_second_script"); The first one will execute and start the second one. Only one condition - there should be no html output.
$php_file = "path/to/file/filename";
$cmd = "nohup nice -19 php {$php_file} > /dev/null 2>&1 &";
exec($cmd);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question