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
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 ...
7
votes
1answer
10k views

PHP 7.4 on raspbian

I'm trying for about 4 hours to install PHP 7.4 on my Raspberry Pi Zero W. I tried different tutorials, but I endup crashing my raspbian completly or just the installed php. With crashing I mean, I ...
6
votes
2answers
36k views

How to install PHP 7.1

Title pretty much says all. I know about adding the stretch to get PHP 7. But it doesn't show PHP 7.1. deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi Bonus ...
6
votes
1answer
904 views

Can I make a WiFi hotspot out of my Raspberry without it having an internet access?

I have made a Xamarin app for Android and WP, which is basically a music player, with the ability to sync music between devices, similar to Spotify, but it's used to sync music that you have ...
5
votes
2answers
29k views

Where is syslog being written?

I have an out of the box Pi. See below on what I have done. If I have <?php syslog(LOG_INFO,'where are you'); ?> in a PHP script, where the the message being logged? $ sudo apt-get install ...
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 ...
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 ...
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 ...
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! :( ...
4
votes
2answers
502 views

Python file called by PHP script in apache server unable to get RPi.GPIO

I've been trying to use a site on my local network to activate the GPIO pins on my Raspberry Pi 4. I installed apache and wrote a quick PHP script which executes a python file in /var/www/html.I have ...
4
votes
4answers
31k views

E: Package has no installation candidate

I am unable to install any package using command "apt-get install". Whenever I execute above command to install any package, it shows me a common error saying E: Package <PackageName> has no ...
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 ...
4
votes
2answers
4k views

Why can't I return value from python script to PHP script when trying to use GPIO

I have spent two days on this and have tried nearly everything I could find. I am using an apache server (2.4.10). I have two files in a folder called testPythonPHP that is located in the root ...
3
votes
3answers
5k views

How do I create a cron job to execute PHP?

I've been trying to execute a PHP file via a cron job, but I can't seem to get it to work. I've set the permissions of the relevant file to 777. Here is the line I've currently got in the crontab file....
3
votes
2answers
98 views

Getting Information from one Raspberry to another

I've got 2 Raspberry Pi's: 1 with a LAN cable, which serves as a webserver 1 with WIFI connected to a circuit, that notices when a circuit is open. (basically a simple alarm) I want to send data ...
3
votes
4answers
5k views

Unable to install mysql

I am trying to install mysql on my pi. I've installed mysql server successfully, but get the following error when I try to run $ sudo apt-get install php5-mysql Some packages could not be ...
3
votes
2answers
4k views

How to Compile and Install PHP7 on raspberry pi?

When i installed PHP on Raspberry PI, PHP version is 5.5.* But, I want to install php7 and when i try to compile it from Source Some Error occurs related to sapi Did someone successfully installed ...
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); ?> ...
3
votes
1answer
70 views

Bug in PHP & Buster? 4x Kernel panic - not syncing: Attempted to kill init! exitcode 0x00000004

I have 2 exact the same Pi's: both are Raspberry Pi Model B Rev 2. Both were running Raspian Stretch for years. 4 days ago both Pi's (!!!) had a Kernel Panic after trying to update to php7.4. Installs ...
3
votes
1answer
1k views

Apache on Pi won't display images

I'm trying to display images on the Apache server created on Pi. PHP Code: $files = glob("/var/www/html/Images"); for ($i=1; $i<count($files); $i++) { $num = $files[$i]; echo '<img ...
3
votes
2answers
2k views

Web controlled OMXPlayer

I want build a web page that has a button to start omxplayer on my Raspberry Pi. I've been searching but with no results. Does anyone know how to do this? I have Apache and Php installed on my Pi.
3
votes
2answers
14k views

PHP-version on Raspberry Pi different in phpinfo()

I have a Raspberry Pi 2 where I want to run my backend for an application on. This needs php 5.6 to run correctly, otherwise it will just not work. I installed PHP 5.6 on this Raspberry Pi, but now I ...
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 ...
3
votes
2answers
239 views

Crontab not executing php scripts

My problem is that crontab is not executing my php script /home/pi/CronTabFiles/saveThermometer.php I tried a lot of things, I don't remember everyone of them but I'll list what i consider mains one. ...
3
votes
1answer
2k views

Printing state of wiringpi pin onto webpage

I have a Pi set up with Apache and wiringpi, and I would like to read the state of an in pin (every 20 seconds, if possible) and display it on my webpage using PHP. The input is to determine if my ...
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 ...
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 ...
2
votes
3answers
3k views

How to build a raspberry devices monitoring center

I have multiple devices of Raspberry and i'm trying to create a page to monitor these devices, something like an IoT platform but much simpler. so basically a page with a username and a password and ...
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
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 ...
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 ...
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 ...
2
votes
1answer
992 views

PHP5, MySQL & MySQLAdmin issues on latest raspbian stretch release

A day or two ago I downloaded the latest release of raspbian stretch. I am currently busy installing all the components I require for a web server and mysql server. In the latest release, PHP5 has ...
2
votes
1answer
3k views

Win 10 IoT + apache + php + mysql + ssl?

I'm looking for an easy way to get on Win10 webserver based on apache (or familiar), php, mysql, and ssl (all 3 must have). Everything I found on google has no info how to do it... only how to change ...
2
votes
2answers
5k views

Shell_exec is not working!

I have Raspbian os and trying to run GPIO commands from a PHP file. Unfortunately the shell_exec is not able to execute any command! 99% I am sure it is a permission issue! I search in Google and read ...
2
votes
1answer
11k views

PHP doesn't work on Apache on RPi

I just installed apache2, php, mysql, phpmyadmin, and vftpd (to add files via filezilla) on my raspberry pi, which is used as a local web server. I created a simple index.php page with Brackets (a ...
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
509 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 ...
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 -...
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 ...
2
votes
2answers
1k views

Raspberry pi PHP display code instead of output

I installed php services and Apache2 on my raspberry pi without errors. But, when I opened a browser and entered my page URL, it wrote <?php echo "Hello";?> instead of Hello. I have tried ...
2
votes
1answer
664 views

Raspberry PI - Apache Web server - 403 forbidden access only on some computers [closed]

Yes, I read through a lot of the related questions, but I can't seem to make sense of my problem. So, I successfully installed the latest Apache server along with PHP5 on a Pi. It works as it should, ...
2
votes
1answer
3k views

Wi-Fi scanning and displaying using Python run by PHP

does anyone know it it is possible to scan for Wi-Fi and display the output of the results using a Python program that is run by a PHP button on a Raspberry Pi web page server? The idea would be to ...
2
votes
1answer
929 views

How to install WampServer on Windows 10 IoT core?

I would like to write a PHP application on Windows 10 IoT for the Pi, is there any anyway to install WampServer on Windows 10 IoT for the Pi?
2
votes
1answer
2k views

How to run terminal command from php file

I have a python file on my raspberrypi that makes an led blink, which i made executable with chmod +x file.py so that in terminal i can run ./file.py and the led blinks. I then wrote a php file (in ...
2
votes
1answer
674 views

Can't access Pi websocket server from client

I have all of my code on github, so I can edit my code on the fly, and simply do a git pull from the Pi and have my code updated. Right now, I'm trying to make a websocket between my Pi server and my ...
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 ...
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 ...
2
votes
0answers
404 views

Unable to install php7.2-intl Depends php7.2-common 7.2.4-1 but 7.2.4-1+b1 is to be installed

While trying to install a NGINX server on a Raspberry Pi 3 Model B Rev 1.2 I was following this tutorial, also tried this answer but both return the error The following packages have unmet ...
2
votes
0answers
579 views

MySQL suddenly broken after restart

I restarted my raspberry pi and now then I got this error on my website: SQLSTATE[HY000] [2002] No such file or directory I look at sudo service mysql status and I can see this. Jan 09 17:34:45 ...

1
2 3 4 5