Kavian Rabbani Kavian Rabbani - 1 year ago 126
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 ?

Answer Source

You need to use the absolute path, try with


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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download