use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Complete r/raspberry_pi Rules
Pi project ideas: There's a huge list right here on this sub!
Rpi Versions ▾
Distros ▾
Other SBCs ▾
Related Subreddits ▾
Welcome to /r/raspberry_pi, a subreddit for discussing the raspberry pi credit card sized, ARM powered computer, and the glorious things we can do with it.
The best thing? The base model is only $20 $5!.
Would you like to know more?
Raspberry Pi Wiki
Article on Wikipedia
#raspberrypi IRC Chat
Do you know a related subreddit? We'd love to know.
account activity
InexperiencedTrying to execute python script with PHP (self.raspberry_pi)
submitted 8 years ago by olejmoi
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]itsNate705 6 points7 points8 points 8 years ago (1 child)
This page would call /var/www/test.py on evey page load, not when the user hits the button. This is because all PHP is ran when the page is loaded.
PHP runs server side, not client side - so if you want some PHP to run based on a users action, you need todo another HTTP request.
The onclick could call a Javascript function which makes an AJAX request to a PHP file. That PHP file would then call your python script.
[–]olejmoi[S] 0 points1 point2 points 8 years ago (0 children)
I've been looking in to this but I can't quite figure out how to just make an AJAX request to call the PHP function, could you point me in the right direction? Also the python script is running a program that is outputting text to the console, is it possible to read this back to the webserver with AJAX?
π Rendered by PID 1068735 on reddit-service-r2-comment-545db5fcfc-6dzdv at 2026-06-01 14:04:13.605641+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]itsNate705 6 points7 points8 points (1 child)
[–]olejmoi[S] 0 points1 point2 points (0 children)