Question: I have to manage a cash register from PHP. If I run the following commands via cmd there are no problems. The cash register print the string perfectly.

I write the commands in this order:

```
powershell
[System.IO.Ports.SerialPort]::getportnames()
$port= new-Object System.IO.Ports.SerialPort COM1,9600,None,8,one
$port.open()
$port.WriteLine("1R")
// Print string 1R on cash register

```

The problem comes when I try to do this from php. I created a web server ( XAMPP ) to ensure that it can send commands from php to the serial port . I tried various ways of writing the script, but none of them work. Here's an example of my .php

```
<?php
$patch = "c:\\Windows\\System32\WindowsPowerShell\v1.0\powershell.exe";
$runCMD1 = $patch .'[System.IO.Ports.SerialPort]::getportnames()';
$runCMD2 = '$port= new-Object System.IO.Ports.SerialPort COM1,9600,None,8,on';
$runCMD3 = '$port.open()';
$runCMD4 = '$port.WriteLine("1R")';

exec($runCMD1, $out1); // Return COM1
exec($runCMD2, $out2); // Return Nothing
exec($runCMD3, $out3); // Return Nothing
exec($runCMD3, $out3); // Return Nothing
?>

```

Everyone can help me? Thanks.

Answer: 
You can use many web server and app server to deploy Django app but **[here](http://jee-appy.blogspot.com/2017/01/deply-django-with-nginx.html)** in this tutorial all instruction are given step by step and there is a **[video tutorial](https://www.youtube.com/watch?v=jN9iPaQzZbQ)** as well to guide through all the instruction to deploy the django app using `Nginx`, `vritualenv`, `gunicorn`. 

Hope this is helpful for newbies.
You can deploy with nginx and gunicorn.
There is a great example to do this:
[How To Install and Configure Django with Postgres, Nginx, and Gunicorn](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn)

and one more:
[Setting up Django with Nginx, Gunicorn, virtualenv, supervisor ...](http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/)

I hope this will help.