# Howto call an external (Python) Script?

**URL:** <https://discourse.cakephp.org/t/howto-call-an-external-python-script/9731>\
**Category:** Need Help\
**Created:** [September 22, 2021, 6:40pm UTC](https://discourse.cakephp.org/t/howto-call-an-external-python-script/9731 "2021-09-22T18:40:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Herzberg](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@Herzberg](https://discourse.cakephp.org/u/Herzberg)\
**Post date:** [September 22, 2021, 6:40pm UTC](https://discourse.cakephp.org/t/howto-call-an-external-python-script/9731/1 "2021-09-22T18:40:21Z")

</div>

Hey, I have an external Python Script that i want to execute inside of my Cakephp App to manipulate an Image. How can i do that?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [September 23, 2021, 7:34pm UTC](https://discourse.cakephp.org/t/howto-call-an-external-python-script/9731/2 "2021-09-23T19:34:22Z")

</div>

`shell_exec('python <path-to-pythonscript>')`  
But let me warn you: Don’t allow users to controll what is being input into the shell\_exec, otherwise you have a major security hole.  
Not really CakePHP related but more generally PHP related.

---

<div class="post-metadata">

**Author:** ![Herzberg](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@Herzberg](https://discourse.cakephp.org/u/Herzberg)\
**Post date:** [September 23, 2021, 7:57pm UTC](https://discourse.cakephp.org/t/howto-call-an-external-python-script/9731/3 "2021-09-23T19:57:30Z")

</div>

ok thank you! No I will only execute it on an imagefile that will be uploaded before…

Sorry I didnt know it will just work like this… there could be some cakephp configuration before…
