Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
41 views

Run Python script from HTML input button [closed]

I have some HTML form code: <form action="proses.php" method="post"> Nomor Polisi : <br><input type="text" name="nopol"><br> <input type="submit" id ="submitButton" ...
0
votes
0answers
27 views

Do I need to install PHP 7.2 to access MariaDB with PHP7.2 on raspi?

I setup a SQL Database with MariaDB on my Raspberry Pi 3B+ and it worked fine. The PHP Script I wrote uses an old PHP Version, so I wanted to upadte the code to 7.2 But then I can't connect to it ...
0
votes
0answers
30 views

Run Python code from PHP

This is probably a Linux question, but concerns specific Pi code. I am using the DHT11 class from http://abyz.me.uk/rpi/pigpio/download.html and have written a program which uses this. #!/usr/bin/env ...
0
votes
0answers
28 views

NGINX server on RPI cannot read POST request

I want to send data from an ESP32 board to my RASPBERRY PI with a NGINX server on it. I load on my ESP32 a program from the ARDUINO IDE. In this program I use the library HTTPClient.h form which one ...
0
votes
1answer
28 views

LLMP server tutorial

I have searched Google for an answer but cant find an up to date tutorial for creating a LLMP server (Lighttpd instead of Apache). I find one follow it and think I'm getting somewhere and its a year ...
1
vote
0answers
22 views

Apache HTML writing on Raspbian + Pi3 [closed]

I currently have a PI3 on my home network. With my LAMP apache, I keep the www folder on the USB drive - let's call it "/media/USB32/www". My user id is Tony. I have added my user-id to group www-...
0
votes
0answers
59 views

Running python in PHP shows error. -sudo: no tty present and no askpass program specified

I want to run a python script to turn an led on from PHP. The script did not run. I used echo to print the error. It said "sudo: no tty present and no askpass program specified". What should I do? ...
0
votes
1answer
248 views

Read GPIO pin on web page

I was able to control an led from a web page using the following code. when I call http://myip/pinon.php it will light up the LED and http://myip/pinoff.php will turn off the LED. pinon.php <?php ...
1
vote
0answers
34 views

PHP not executing commands

I have an apache web server installed in my Raspberry Pi. I created an index.php file on the /var/www/html folder. Whenever I access my Pi's IP address on a web browser to control the lights, none of ...
1
vote
1answer
87 views

Uninstalled Lighttpd, installed apache and PHP. PHP not executing

Title says it all. Lighttpd was automatically installed by RaspAP, a wifi web GUI not being part of Raspbian repository. But I require Apache. Uninstalled Lighttpd, Installed apache with PHP & ...
0
votes
1answer
62 views

Besides WebIOPi, what can I use to control the GPIO's(http.server library,Flask PHP)?

I used WebIOPi to test (and debugging) the RPi ports, it is easy and hepful. But now I want to create a webpage (as I can use html/css e create a nice modern interface). I don't know how to use ...
0
votes
1answer
256 views

rewrite /etc/dhcpcd.conf file as www-data user (with php)

I've got a small problem changing the IP of my Raspberry (Raspian Stretch lite) via PHP. I wrote a small php page to modify the IP-Address setting by reading a template file replacing the blanks and ...
0
votes
1answer
61 views

RPi, php, python and string lengths

Are there limitations on the length of strings passed to php by python in a service? I had a php service running that retrieved data from a python script. Worked well. I decided to add data from ...
1
vote
1answer
53 views

Getting changes in the timezone on a raspberry pi reflected in PHP

I am using the lighttpd webserver on a pi running raspbian stretch, with php version 7.0. I can get a string representing the current date, time and timezone information onto a web page by calling ...
0
votes
1answer
33 views

Three sites - three nginx conf files - all resolve to same directory

I recently tried one too many things and had to re-flash the SDCard in my Raspberry Pi. Started over with Raspbian Stretch Lite. Added nginx, PHP7.0-fpm and a self-hosted social media service (Pleroma)...
1
vote
3answers
346 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
0answers
267 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 ...
0
votes
0answers
23 views

raspberry pi- local host -terminal at computer

I am working on serial communication between local host and terminal name termite at computer. local host send and receive string to termite using raspberry pi. in it php code is used to web ...
1
vote
1answer
35 views

Php7.0 is installed, but service doesn't appear in services list

I have install php7.0 and some it extention, but when I type "sudo service php7.0 restart", what I found is "Failed to restart php7.0.service: Unit php7.0.service failed to load: No such file or ...
0
votes
1answer
478 views

Control servo motor using a web server

So I'm trying to get this to work. I have a .py file that turns the servo, and it works, but I'm trying to run it through a browser. So I installed apache and php, and I made .php file which, when ...
-1
votes
2answers
2k views

How to run python file from php script [closed]

I have all files placed under var/www/html folder. When I click my button on web page the php file must run the python file and give the ouput at the GPIO pins. But nothing is happening so. Anybody ...
0
votes
1answer
27 views

php file is downloaded instead of running at the backend [closed]

I have installed Apache2 Mysql and php7 on my raspberry. When I am running my web pages under var/www/ folder the php file is downloaded instead of running at the backend and refer me to next page. ...
0
votes
1answer
1k views

Run python script from php

Hello I want to run python script from php. Python script is for reading sensor data. This is python code and it's file name is sensor.py import bluetooth bd_addr="(mac address)" port=1 sock=...
1
vote
1answer
1k views

How can I display sensor data on webserver by php? [closed]

I want to display sensor data on web server. I measure sensor data by arduino and it sends sensor data to raspberry pi via bluetooth(wireless). There are codes for logging data. code of arduino #...
1
vote
0answers
72 views

How to solve Rpi3 usb problem while printing?

I am printing from an rpi3 using nginx+php7.1+cups, connected to a canon printer, which downloads pdf files through https requests. From the rpi3, i issue the following command when something needs to ...
0
votes
0answers
118 views

Raspberry pi owncloud or nextcloud setup

I am a java developer, so, I setup the apache tomcat 8 in my raspberry pi and able to host the java web application and use it and what I want now is my own cloud storage and I have found lot of ...
1
vote
0answers
114 views

WiringPi can only turn on 8 LEDs

On my RPi 3 I have a PHP website to control 10 LEDs. Each is wired to a separate GPIO pin and 220 ohm resistor. Here is the code: <html> <head> <title>LED Control</title>...
0
votes
2answers
7k views

Unable to install PHP

I can't install PHP on my raspberry pi. I did sudo apt-get install php libapache2-mod-php php-mcrypt and then showed me this: Reading state information... Done E: Unable to locate package php E: ...
1
vote
2answers
82 views

Turning motor on and off from webserver

I have Apache server running on my pi. I send a httprequest from my Java app to the server to turn the motor on and off by executing a pyhton script. PHP code on the server: <?php if(isset($_POST[...
-1
votes
1answer
626 views

How I can use a barcode scanner and PHP/MySQL to run a database? [closed]

I am currently trying the following with the help of a Raspberry Pi: Barcode scanner scans barcode (connected to the Raspberry Pi via USB Port) (via Python?) A hidden form is filled in The user only ...
1
vote
0answers
231 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
vote
1answer
1k views

How can I install php5-pgsql on a Raspberry Pi 2?

I tried these commands to install php5-pgsql but I got an error: pi@raspberrypi:~ $ sudo apt-get install php5-pgsql php-pear Reading package lists... Done Building dependency tree Reading state ...
0
votes
0answers
44 views

RPi3 PHP serial0 - When Receive a Char - RPi sends a echo to TxD Pin

my problem: I read 3 chars from /dev/serial0 and I can it process - Ok. Now I have taken my scope and see that a echo from this 3 chars is appearing on the TxD Pin + 0x0A (LF)+ 0x0D (CR) - in sum 5 ...
0
votes
2answers
229 views

I need php5, what version of NOOBS shall i download

I just installed NOOBS onto the SD card but I have just messed it up, it wasn't right for me anyway since I needed php5, and the latest NOOBS comes with php7. How can I install NOOBS so that I can ...
0
votes
0answers
321 views

Delay with POST request using Python with GPIO

I have made a smart doorbell and subscribed to a website that does Machine Learning so that I can predict an image when sent to the server. However, while testing the code using POSTMAN API ...
2
votes
1answer
763 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
300 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, ...
0
votes
0answers
80 views

GPIO command in PHP works locally, but not remotely (Apache2)

It's basically just a simple exec("gpio write 15 1"); command. The script below works fine on my rpi3 in Apache2. But it doesn't work, when I try to execute it from my remote host. I'm trying to run ...
0
votes
3answers
2k views

Variable which can be used between a python and php file

I need 14 variables globally whose value can be manipulated by both php and python program. The python program just wants to read the value of the variable. The PHP program should write the value of ...
2
votes
3answers
2k 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....
1
vote
1answer
851 views

broken network — ping works on IP addresses but not on hostnames

I did a fresh install of raspbian on an rpi-3 with the intent to follow this guide to set up an owncloud server However after some first steps, when I reboot and reconnect I get the strange problem ...
0
votes
1answer
363 views

Unable to run PHP on Raspbian Jessie

I have installed Apache on my Raspberry Pi without incident. However, I cannot install PHP correctly after having tried various methods. It appears to have installed but I cannot get PHP to output. I ...
0
votes
1answer
660 views

[PHP][HTML] Create a list of songs, press play button to play the selected song

I am trying to achieve the following : I want to start a selected song on the rpi from a web interface. I can play the song through exec exec("mpg123 /var/www/html/Sounds/Zelda.mp3",$status); and I ...
0
votes
2answers
336 views

WiringPi, PHP: Interrupt driven event counter

I am planning to set up an HTML-PHP website gui which opens up in Chromium Kiosk mode. I want the gui to count the number of falling edge interrupts and show the count on the GUI. I have achieved ...
2
votes
1answer
2k 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 ...
3
votes
1answer
468 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 ...
4
votes
2answers
1k 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 ...
0
votes
2answers
872 views

PHP script is not returning to main page after calling Python script

I am designing a Raspberry Pi based home automation unit in which the Pi will communicate with several atmega328p microcontrollers (in each room) via nrf24l01. Atmega side will not be a problem, but I ...
3
votes
4answers
4k 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 ...
4
votes
1answer
25k 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 ...