apache configuration for simple python run in kali linux through php script -


the problem:

how apache configuration simple python program run in kali linux through php script.

i tried shows blank window. php script:

<?php     $co = escapeshellcmd('/root/desktop/python1.py');     $op = shell_exec($co);     echo $op; ?> 

in var_dump shows null. me..

you want point shell program

<?php $co = escapeshellcmd('/bin/sh /root/desktop/python1.py'); $op = shell_exec($co); echo $op; ?> 

or use python self

$co = escapeshellcmd('/usr/bin/python /root/desktop/python1.py'); 

ps

when know command, escapeshell redundant, can use shell_exec directly

<?php  $op = shell_exec('/bin/bash /root/desktop/python1.py'); echo $op; ?> 

enter image description here


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -