I have a python script beside 'routes.php' and I want to execute that from 'routes.php' file .
when i use exec() function it does not work correctly .
so , i try
if (file_exists( "new.py" ))
You need to use the absolute path, try with
Assuming that it is in the same directory as routes.php