'Selenium keep php file from loading

I have a problem that gave me nightmares for couple of days. I am trying to run some python script from a PHP file. I am using wamp64 for hosting. Python script works fine when i run it from cmd but when it is called from php file it is not running. However if i comment out the selenium part(imports) everything works fine.

#!/usr/bin/env python
#from selenium import webdriver
#from selenium.webdriver.common.by import By
#from selenium.webdriver.support.wait import WebDriverWait
#from selenium.webdriver.support import expected_conditions as EC
import time
import sys 

if __name__ == '__main__':
    
    email = sys.argv[1]
    password = sys.argv[2]
    print(email+password) 

PHP file:

$cmd = 'python C:\wamp64\www\Project_php\index\test.py'.' '.$email.' '.$pass.' &';
   $command = escapeshellcmd($cmd);
   $output = shell_exec($command);
   echo $output;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source