Questions tagged [php]

A widely used, general-purpose scripting language designed for web development. This topic covers the use of PHP and how to host PHP web servers on the Raspberry Pi.

Filter by
Sorted by
Tagged with
0
votes
1answer
210 views

stty command lag and queue issue

I have plugged in a serial-USB, and run the command: stty -F /dev/ttyUSB0 38400 Then I am using PHP to send calls to the serial-USB like: file_put_contents("/dev/ttyUSB0", chr(6).chr(255).chr(0)....
2
votes
2answers
3k views

How can I use a usb barcode reader with my raspberry pi

I want to get a WCR3237-700 ID Tech USB card reader and attach it to my raspberry Pi. The end goal is to use it to unlock a magnetic lock (when the correct card.) I am currently running PHP scripts ...
1
vote
3answers
2k views

PHP USB serial port call from Windows to Linux

I have a piece of simple code that works on a Windows - WAMP environment, e.g. <?php `mode com3: BAUD=38400 PARITY=N data=8 stop=1 xon=off`; file_put_contents(com3, chr(1).chr(255).chr(1).chr(4)....
1
vote
1answer
1k views

PHP controlling LED through a script. Can't get it to work

I have made a very small script for my Raspberry Pi where I turn on the LED. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(21,GPIO.OUT) GPIO.output(21,1) time.sleep(5) GPIO....
0
votes
3answers
3k views

PHP or jquery to execute python scripts for GPIO

I want to use php or jquery to control gpio pins on my raspberry pi 2. I have apache installed. When i execute python files using LXTerminal, they work fine. I have made the .py files executable and ...
1
vote
2answers
887 views

Install PHP 5.6 on Raspbian version 2015-5-5

This may be a stupid question : I followed the instructions of this post on Raspbian and a Raspberry Pi 2, and after 20 min it was still running the make -j4. I stopped it because it was heating too ...
12
votes
2answers
21k views

How can I install PHP 5.6 (instead of 5.4)?

I'm actually stuck with a little problem. I want to use Laravel on my pi but it requires at least PHP 5.5.9. But actually, the latest version of PHP that I am able to install (via the official ...
2
votes
3answers
7k views

reboot raspberry remotly from webserver

I have many raspberries located in different places. All of them are connected to my website and download videos to show on their respective monitors. Is it possible to send some command from my ...
0
votes
1answer
1k views

How to install cakephp on Raspberry Pi? [closed]

I tried to install cakephp on Raspberry Pi but failed to do so. I don't know how to configure LAMP on Rpi. Has anyone successfully done so? I have developed a cakephp app on Windows running on WAMP ...
1
vote
2answers
754 views

Timeout issues with Raspberry Pi 2 on network

I am running a small web application on Raspberry Pi 2 (OS latest Raspbian, and no overclocking, samba installed) which runs on Apache, PHP, and MySQL. The web app lets users punch a simple tickets ...
0
votes
1answer
2k views

How can I remotely shutdown a Raspberry PI from my network via a Web Interface?

I am wondering how I could possibly input the values for option (e.g -r), time (e.g now) and message (e.g Shutting down), I have tried: system("shutdown " . $option . "-t " . $time . " " . $message); ...
0
votes
2answers
4k views

Reading GPIO status only works outside of PHP if statement?

I can read a GPIO pin's status as such: <?php exec ( "gpio read 7", $status ); print_r ( $status ); ?> this works fine. But I want to read the status from within a php if statement, ...
2
votes
1answer
2k views

How to stream video from raspberry pi? [duplicate]

I own a raspberry pi model B+. A webpage is hosted on raspberry pi and i want to display a real time video stream from a webcam.The stream should be embedded on the web page (shown below) The webcam ...
2
votes
2answers
508 views

how can I install php5-readline in Raspbian?

how can I install php5-readline in raspbian? its not in the repos. And not in the debian repos with Wheezy arm support. Update: November 2015 I abandoned Raspbian and moved to Pidora, which seems ...
0
votes
1answer
1k views

Is there a way to display images from raspistill on a webpage without saving them on the file system first?

I'm working on a web page that I would like to be able to constantly display images taken by the raspberry pi camera (about one per second) in real time. my problem is I don't want to save, read, then ...
0
votes
0answers
507 views

Web based IR/RF device control over long range

I am trying to implement a Building Automation System where I would like to implement web-based or mobile based control of all ir/rf based devices like tv,a/c,sound system, etc. The PI will be placed ...
5
votes
1answer
7k views

Shutting down Raspberry Pi with PHP

I built this dashboard for my Raspberry Pi and would like to be able to shut it down and reboot it with a click. I have the following in my html which redirects to a script and gets a PHP page with ...
-1
votes
2answers
13k views

phpMyAdmin MySQLi extension error

Oh, this way to make code on this site... I followed tutorial on this site to install phpMyAdmin: http://www.raspipress.com/2012/09/tutorial-install-phpmyadmin-on-your-raspberry-pi/ Here it's what I ...
1
vote
1answer
2k views

Web server autostart [closed]

I have some project in php ( including sql ). What server should I use for it? When the pi will started It need to autostart server and open browser in fullscreen without url bar and other tools, only ...
3
votes
1answer
8k views

How do I stop a python script from running via a webpage?

So I have a a webpage that has buttons to run a script that controls a PIR sensor and an LED. How do I stop the script from running using a second button? Button 1 : Run sensor.py Button 2 : Stop ...
0
votes
1answer
786 views

Raspberry and sessions - unusable slow

I´m running my project on my raspberry with Apache2 and PHP5. It´s non public, so me and a friend are currently the only users. The site basically executes shell commands and waits for their finish. ...
0
votes
1answer
2k views

Running Python script From php that create a thread and then kill it [closed]

I am a python newbie, very interested in raspberry pi and while I was crusading the code I had one idea, tried a lot of ways to make it but with no success. I'm using this python script to get data ...
1
vote
1answer
395 views

What is the best way to let website users control devices on the Raspberry Pi?

I have a simple robot I am working on. There is a webpage, using arrows to navigate, and a streaming webcam. I've been reading that using exec(command) is insecure. Unfortunately, I don't know how to ...
1
vote
0answers
504 views

Text to Speech Using Apache Web Server

I have Apache Web server installed on my Raspberry Pi. I was wondering If I could use javascript,html, and php to create a webpage where the user types some text into a text field and then that text ...
-1
votes
1answer
1k views

Could not find driver when I trying to display my PHP

After going through a few tutorials of displaying data to php from python and my sqlite database, I keep getting this error and don't know how to fix it. I'm in need of urgent help. Error Message ...
-2
votes
1answer
1k views

How to display database in plain HTML or PHP from Python [closed]

How do I just display what's in my database in plain HTML or PHP without any GUI interface or layout, just plain database display? Is it possible? This is my Python code: import sqlite3 import RPi....
0
votes
1answer
3k views

Running a PHP Mailer Script via Cron

I have a php mailer script that needs to run every hour via cron job. Basically it collects information from a database attaches this in the phpmailer via html and sends it out. Via the web service ...
1
vote
1answer
2k views

using php_exec command to play audio on the Pi - no audio group

I'm trying to have a php script play an audio file when run shell_exec('aplay /home/andrew/www/audio/meeting-bell/medium-bell.wav') It works when I run it from the command line, but not when running ...
0
votes
1answer
4k views

Web server not displaying pages, and apache error 403 for new files

After setting up a web server on my pi following the instructions here - http://www.wikihow.com/Make-a-Raspberry-Pi-Web-Server, everything goes fine except for when I view the web server. The test ...
2
votes
1answer
12k views

How to use python to run php [closed]

I have a php script that runs well. <?php include_once "lib/m2x.php"; $api_key = "API KEY"; $feed_id = "FEED ID"; $stream = "something"; $m2x = new M2X($api_key); $data = array( 'value' =&...
2
votes
2answers
2k views

Control GPIO from outside home network

I'm not exactly the most knowledgeable on the server-side aspects of how this kind of thing should/would work, but I do tend to pick things up pretty quickly. I've played around with WebIOPi and a ...
5
votes
1answer
18k views

Live video streaming embedded in a web page [closed]

I have created a web page to have both live video streaming and some button controls to control the robotic arm interfaced to the RPi GPIO pins. For button controls, I used php coding. The php coding ...
2
votes
1answer
2k views

How to merge port 80 and port 8080? [closed]

i would like to seek your opinion on this as I have little idea about the whole structure and not sure where to find more information. Currently I have this problem of having both Apache2 and ...
0
votes
1answer
971 views

Access phpmyadmin from Cherrypy port 8080

I can access phpmyadmin from the host (raspberry pi) ip address (http://192.168.1.109/phpmyadmin) but i am running a server at port 8080 with cherrypy. I couldn't access http://192.168.1.109:8080/...
2
votes
1answer
1k views

eSpeak over PHP on Raspberry PI

So I am trying to make a webserver on my Raspberry Pi which plays a voice using eSpeak whenever a page is loaded. I have installed apache2 and php5, and I also have a script to run eSpeak which I have ...
1
vote
0answers
2k views

php $_FILE doesn't work

I followed all the steps from tutorial WikiHow - Guide to install PHP I can execute normal php commands, but can't upload files using $_FILE command.It always gives me error. My File uploading ...
0
votes
1answer
7k views

cat /sys/class/gpio/gpio17/value permission denied [get the gpio status via php]

I am trying to get the status of gpio17 via php like that: (Installed: Raspbian, Apache2, PHP5) This is what i do: echo "17" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio17/...
3
votes
1answer
292 views

Controlling GPIO from website on a separate server

I am planning on doing a bit of home automation. I decided on going with the Raspberry Pi, because it is cheap, and can connect to the internet wirelessly via a USB dongle. I was planning on ...
1
vote
3answers
6k views

Raspberry PI, PHP, MPG123 playing music via 3.5mm jack - No sound via PHP?

Got my PI for xmas and I want to turn it into a web based music player. As a test I run these commands: First, make sure it's using the 3.5mm jack: sudo amixer cset numid=3 1 Then play the music: ...
2
votes
1answer
2k views

Making shell_exec work the way sh does with omxplayer

I have apache2, php5 installed. I'm trying to execute the next code in my php script chdir('/var/www/'); shell_exec('/usr/bin/omxplayer -o hdmi "'.$file_name.'" < omfifo &'); shell_exec('echo -...
3
votes
2answers
15k views

refresh chromium browser by shell script with xdotool via PHP

I want to refresh the browser, like pressing the F5 or Ctrl+F5 key on the keyboard with a shell script. I´m new in writing shell scripts so i aks you to help me with this: when I type in this into ...
2
votes
3answers
9k views

PHP + PYTHON + LIGHTTPD + Raspberry Pi GPIO to control the Robotic Arm

I was able to control one arm of an OWI-535 (Maplin) Robot Arm using GPIO pins and python programming (via L293 driver) , so I tried to do the same using a web page created in PHP. Created buttons ...
3
votes
1answer
343 views

How to display Raspberry´s local IP Adress on a HTML site?

I run raspberry with a strating webbrowser in kiosk mode and want to display the local ip-adress of my raspberry. How can I do this? I Use PHP (httpd) I tried with <?php print_r($SERVER); ?> ...
1
vote
1answer
4k views

Can't install apache

I can't download apache2 and php5: sudo apt-get install apache2 php5 libapache2-mod-php5 Gives me the error "Failed to fetch [URL] 404 Not Found". The raspberry is connected via ethernet to my ...
4
votes
4answers
5k views

Unable to run RaspiStill from PHP

I have been attempting to use RaspiStill in PHP for a number of days now. I have searched around and have been unable to come up with a solution. I have been attempting to use shell_exec() in my php ...
0
votes
1answer
2k views

PHP Can't access external mounted hard drive

I'm attempting to automate a home music system, I've got most of it working. All is working brilliantly thus far, however... I've started seeing this: [Sun Sep 08 17:19:54 2013] [error] [client 192....
0
votes
1answer
3k views

SQLITE/PHP on Raspberry Pi

Wondering if this would be easy/possible. I know MySQL is commonly used but I want to make a sort of web server that can access the Raspberry Pi or more important an External Drive attached to it. ...
4
votes
3answers
53k views

PHP to execute Python scripts for GPIO

I found this code somewhere, that can execute Python scripts from PHP. I've installed apache2 on the Pi and I'm able to access the PHP script. But when I press the HTML buttons, nothing happens! :( ...
0
votes
1answer
2k views

Converting two's complement hex values to binary using PHP

I'm reading x-axis accelerometer data from an IC via the I2C bus using I2C-Tools' ( specifically i2cget ) in Linux. Here is the code that is reading these values: $OUT_X_L_A = shell_exec( 'i2cget -y ...
5
votes
0answers
1k views

How can I read and write data to a Character Device File in Linux with PHP? [closed]

I'm trying to read and write to modules on the I2C bus on a Raspberry Pi using PHP. I'm using fopen() and fskeek(). Below is the code I've been trying to use to read data coming in from the physical ...