Kavian Rabbani Kavian Rabbani - 11 months ago 38
PHP Question

file doesnt exists in routes Http directory laravel 5

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


Route::get('/py', function(){
if (file_exists( "new.py" ))
echo "succeed";
echo "failed";

it only returns failed , so how can I get output from .py file via exec function ?


You need to use the absolute path, try with


Assuming that it is in the same directory as routes.php