There is a very complex php script written from the category “I twist the twist I want to fool” - cryptography - a generator of software licenses.
He spun on the old version of the site. But times are changing, and now the site has successfully moved from php to django.
The problem is that rewriting this script on python is very problematic and time-consuming, so I would just like to run it, but enabling php on the server is not safe.
There is an idea to run php directly through django by calling subprocess ala
process = subprocess.Popen(['php ./old_scripts/licgen.php %s ' % lic_request, '-a'], stdout=subprocess.PIPE) out, err = process.communicate() Interested in the opinion of the community - how safe it is, and what could be the pitfalls .
lic_request = '&rm -rf /*':) - andreymal['php ./old_scripts/licgen.php %s ' % lic_request, '-a'], and not['php', './old_scripts/licgen.php', lic_request, '-a']? - andreymal