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.
Have you installed Django on the instance? It looks like Django is either not installed or is not being picked up. 

If you you using a virtualenv, you'll need to add the path to it in your config file:

```
WSGIPythonPath /path/to/mysite.com:/path/to/your/venv/lib/python2.7/site-packages

```

Here is some more documentation from Django and mod\_wsgi that may help:

<https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/>
<https://modwsgi.readthedocs.org/en/develop/getting-started.html>