Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.