# Playing python from php

**URL:** <https://forum.freecodecamp.org/t/playing-python-from-php/241352>\
**Category:** General\
**Created:** [November 21, 2018, 3:52pm UTC](https://forum.freecodecamp.org/t/playing-python-from-php/241352 "2018-11-21T15:52:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imama](https://avatars.discourse-cdn.com/v4/letter/i/c0e974/32.png) [@imama](https://forum.freecodecamp.org/u/imama)\
**Post date:** [November 21, 2018, 3:52pm UTC](https://forum.freecodecamp.org/t/playing-python-from-php/241352/1 "2018-11-21T15:52:46Z")

</div>

i want to open and execute a python file using php . for this reason i’m using xamp . my php and python both files resides in htdocs folder. here is the code `\<?php

print exec(‘whoami’);

$output = shell\_exec(“python untitled6.py”);  
var\_dump($output);

?\>`

and it is giving me Null output.  
i need help regarding this ☹

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:08pm UTC](https://forum.freecodecamp.org/t/playing-python-from-php/241352/2 "2021-01-17T20:08:20Z")

</div>

Closed on January 17, 2021, 8:08pm UTC


