Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written a c program that controls the parallel port ... and also written a .cgi file which in turn executes the above c program which turns 'on' an led attached to the parallel port.
This thing works fine when i execute the .cgi file by giving permissions to execute. But when i try to do the same thing over the localhost(LAMP server) the .cgi file is getting called but the c program which it should call is not getting executed.
There seems to exist some permissions problem with the web server when trying to access the hardware.

share|improve this question

Try running a Python CGI server like this in the directory with the executable: python -m CGIHTTPServer, and calling it over HTTP. If it works, try switching users to the www-data user (sudo su www-data -) and try again. If it doesn't work, Python will show errors in the console.

You can try checking what groups your normal users belong to, and which users the www-data user belongs to. Most likely, the www-data user needs to be added to dialout and/or plugdev.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.