0

I'm trying to execute a Python script from a Laravel project in Ubuntu 20.04 using this code:

passthru('/usr/bin/python3 /var/www/birra/public/setauto.py DB_D1 false');
$output = ob_get_clean(); 

This works perfectly in Laravel Development Server but for some reason it won't work in Apache. I found this SO post where someone suggested it could be a permission problem so I granted all just to check, and made www-data owner.

-rwxrwxrwx 1 www-data aid-pc     925 Jan 22 13:51 setauto.py

I also copied the cli php.ini to apache's php.ini. Restarted apache and tried config:clear. None of these worked. Any idea of why is this happening and how could I solve it?

This shows no error, just passes as if everything went right but the script is clearly not executed since it should have affected some variables that remain the same. It also returns output=""

I also tried enabling CGI in Apache for python scripts as shown here, but it still behaves the same way.

Gamopo
  • 101

0 Answers0