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
1
vote
0answers
34 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
1answer
1k 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 ...
0
votes
3answers
302 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
466 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
349 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
894 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
131 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
278 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
67 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)...
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
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 ...
1
vote
2answers
94 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
1k 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
10k 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
108 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
2k 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
4k 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
167 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 ...
1
vote
0answers
184 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>...
1
vote
2answers
17k 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
167 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
1k 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 ...
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
vote
1answer
2k 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
2answers
519 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
678 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
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
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, ...
0
votes
3answers
5k 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 ...
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....
1
vote
1answer
1k 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
569 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
1k 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
689 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
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 ...
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 ...
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 ...
0
votes
2answers
2k 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
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 ...
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 ...
0
votes
1answer
2k views

Running Python from PHP. How do you get GPIO to work?

I am trying to turn on a LED (using the RPi.GPIO python library) if the player enters the correct number on a webpage. I'm serving up a php file using apache (that bit is ok). snippet from '/var/www/...
1
vote
1answer
6k views

Python script won't run on PHP

My goal is to write a string through the serial of my Raspberry Pi which will then be sent towards an Arduino and I'll read it through the Serial Monitor. I got my Python script working and it works ...
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 ...
0
votes
1answer
620 views

Which web server to select to reconfigure phpMyAdmin automatically?

I am trying to install PhpMyAdmin with Nginx server on Raspbian jessie. Both mySQL and Nginx is already installed. When installing PhpMyAdmin, it says to choose the web server. It is showing only two ...
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?
-1
votes
3answers
2k views

Open text file on rasbperrypi using PhP

I'm trying to open a simple text file on my raspberry pi using PhP. This is the code: <html> <body> <?php $myfile = fopen("/home/pi/Desktop/hello.txt", "r") or die("Unable to open ...
0
votes
3answers
3k views

How to call and run Python file on raspberry pi using web based Button?

I have created .py file that is doing job of communicating on UART quite well. Now I want to run that file on button clicking from browser. I have tried exec("python filename.py"); in PHP but that ...
1
vote
1answer
3k views

Cannot install pecl/pear packages

I'm using rasapbian jessie I'm attempting to install pecl_http, raphf, propro and other php modules but I'm getting the following error when I run sudo pecl install pecl_http etc: pecl/pecl_http ...
2
votes
0answers
290 views

xdotool from Apache/PHP script

With Raspbian Wheezy I could do the following without any problem through a PHP script run by Apache on the local Pi: exec('env DISPLAY=:0 xdotool mousemove 20 10 2>&1', $output); But now I ...
0
votes
3answers
236 views

Raspbian PHP Error

I'm building a project that's supposed to connect between my laptop and Raspberry Pi through SSH, it should display data on my Pi's monitor from a database stored on a WAMP server on my laptop. ...