简体   繁体   English

通过php脚本在kali linux中运行的简单python的apache配置

[英]apache configuration for simple python run in kali linux through php script

The Problem: 问题:

How to do apache configuration for simple python program run in kali linux through php script. 如何通过php脚本在kali linux中运行的简单python程序的apache配置。

I tried for this but it shows blank window. 我试过这个,但它显示空白窗口。 php script: php脚本:

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

in var_dump it shows NULL. 在var_dump中它显示NULL。 Help ME.. 帮我..

You want point to a shell program 你想要指向一个shell程序

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

Or use python it self 或者自己使用python

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

PS PS

When you know the command, the escapeshell is redundant, you can use shell_exec directly 当您知道该命令时, escapeshell是多余的,您可以直接使用shell_exec

<?php

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

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM