Ошибка при загрузке файла из VirusTotal только на сервере?

Я использую php-скрипт для выполнения скрипта python, который загружает файл из общей суммы вирусов. Этот скрипт python отлично работает в обычном режиме в командной строке python vt_download.py hash Но теперь, когда iam, переходящий из php-файла, хеш и выполнение это выполняется только часть скрипта, и часть загрузки не работает.

vt.php file – здесь хэш-переменная передается из другого php-файла

 <?php $fileHash = $_POST['hash']; echo $fileHash; $command = escapeshellcmd("python vt_download.py $fileHash"); $output = shell_exec($command); echo $output; ?> 

Теперь он выполняет скрипт vt_download.py

 #!/usr/bin/python print "Downloading file from VT" import sys import requests md5 = str(sys.argv[1]) print md5 params = {'apikey': 'MYAPI', 'hash':md5 } response = requests.get('https://www.virustotal.com/vtapi/v2/file/download', params=params) print response.status_code if response.status_code == 200: downloaded_file = response.content f = open( md5, 'w' ) f.write(response.content) f.close() print "File Downloaded and stored on /var/www/MTP" else: print "No file present" 

Во время выполнения этого скрипта в браузере он печатает только этот

 c75b5e2ca63adb462f4bb941e0c9f509Downloading file from VT c75b5e2ca63adb462f4bb941e0c9f509 200 

И в основном файл не может загрузить. Но когда я выполняю это из терминала, как это.

 researcher@lab:/var/www/MTP$ python vt_download.py c75b5e2ca63adb462f4bb941e0c9f509 Downloading file from VT c75b5e2ca63adb462f4bb941e0c9f509 /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. SNIMissingWarning /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning 200 File Downloaded and stored on /var/www/MTP researcher@lab:/var/www/MTP$ ls beta.php c75b5e2ca63adb462f4bb941e0c9f509 

Файл загружается здесь. Что конкретно происходит при выполнении из php-скрипта. Все предложения по этому поводу?

Ошибки Python устраняются с помощью -W ignore