Bug #74965 [NEW]: exec() does'nt work anymore since PHP 7.0 was updated to version 7.0.21.

From: Date: Fri, 21 Jul 2017 14:11:09 +0000
Subject: Bug #74965 [NEW]: exec() does'nt work anymore since PHP 7.0 was updated to version 7.0.21.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210169@lists.php.net to get a copy of this message
From:             jean-christophe dot ventre at wanadoo dot fr
Operating system: windows server 2012R2
PHP version:      7.0.21
Package:          *General Issues
Bug Type:         Bug
Bug description:exec() does'nt work anymore since PHP 7.0 was updated to version 7.0.21.

Description:
------------
//googleApiKey : using a python script this allow the final user to see
his own reports //without the necessity to be login in

$cmd='.\assets\python\service-account.py C:\\Python27\\python.exe';
exec("$cmd", $output);
$this->data['googleApiKey']=$output[0];

This script doesn't work anymore since the php update from 7.0 to
7.0.21.


I do not have any error message, for example 


$cmd='.\assets\python\test.py C:\\Python27\\python.exe';

$mystring = exec("$cmd", $output, $return_var);
echo 'result : ' .$mystring.'</br>';
echo 'return_var :'.$return_var.'</br>';
var_dump($output);

will display

result : 
return_var :1
array(0) { }

where test.py :

# -*-coding:Latin-1 -*
import os 

def result():
 print("resultat")


if __name__ == "__main__":
    result()	






Test script:
---------------
$cmd='.\assets\python\test.py C:\\Python27\\python.exe';

$mystring = exec("$cmd", $output, $return_var);
echo 'result : ' .$mystring.'</br>';
echo 'return_var :'.$return_var.'</br>';
var_dump($output);


where test.py :

# -*-coding:Latin-1 -*
import os 

def result():
 print("resultat")


if __name__ == "__main__":
    result()	


-- 
Edit bug report at https://bugs.php.net/bug.php?id=74965&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=74965&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=74965&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=74965&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=74965&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=74965&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=74965&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=74965&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=74965&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=74965&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=74965&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=74965&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=74965&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=74965&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74965&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=74965&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=74965&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=74965&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74965&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=74965&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=74965&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#210169) next »