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
0 answers
20 views

Whenever I go to my local Pihole website it displays the php file contents instead of the website

It´s really simple. I go to my pihole dashboard and this shows up:
user avatar
  • 1
0 votes
1 answer
41 views

How to run a python script that plays an audio using php?

recently I'm doing a small project, and a part of it involves running a python script using PHP. to explain further: Python: from playsound import playsound playsound("path/of/the/audio") ...
user avatar
0 votes
0 answers
47 views

how do i pass php variable to python script

I want to php file that pass file name to python script. The python script will open that particular file. What i did: php file $filename = "stringfile"; $command = "python ...
user avatar
0 votes
0 answers
77 views

How do I send data from sensors using a Raspberry Pi over WiFi to a webpage?

So far I have the code that reads the distance using the razbery pi sensor, but how can I do the rest? if anyone can help me with a tutorial so I can understand, I'm new and I don't really understand ...
user avatar
0 votes
1 answer
45 views

RPi data collection interrupted by WiFi

I have a Raspberry Pi running a solar array. Thr array feeds charge controller which feeds the RPi. The RPi drives the array positioning circuitry (single-axis traqcking) and performs data collection ...
user avatar
0 votes
1 answer
20 views

PHP unable to correct problems, you have held proken packages

I am currently trying to install a php version above 7.1.3 on my Raspberry pi 3b+ (runnning raspbian 9 and the current php version is 7.0.033). My apache is version 2.4 (the newest if i am not wrong). ...
user avatar
2 votes
2 answers
6k views

php8.0-json library not found when updating Pi-hole

When updating pi-hole I got a message: Checking for php8.0-intl (will be installed) Processing apt-get install(s) for: php8.0-cgi php8.0-json php8.0-intl, please wait... ------------------------------...
user avatar
1 vote
2 answers
126 views

Python Import Module issue, works from terminal, not when called from PHP

I have a simple Python (sockets.py) module which operates some Energenie sockets. See below. Note the print statements are simply there as a basic 'breakpoint' function so I can see how far the module ...
user avatar
  • 21
0 votes
1 answer
241 views

MPG321 "Home directory not accessible: Permission denied" on PHP exec_shell

I try to execute a shell from a PHP using exec_shell() function, but it doesn't working. I've tried chmod, chown and doesn't execute but on terminal yes. Sorry for this question but I really need a ...
user avatar
1 vote
0 answers
26 views

PHP Handler for my LAMP server

I have a Pi4 4GB and i am using a Samsung Fit USB 3.0 32GB as Hard Drive. I have set up a LAMP Server and i would like to know what handler will work better? Apache 2.0 or PHP-FPM 7.3? or any other ...
user avatar
  • 127
1 vote
1 answer
646 views

Python import won't succeed when script is exec() from Apache PHP

I have a Python3 script (readtemp.py) to read temperature and humidity of a DHT22. I'm using adafruit_dht module. it executes perfectly from terminal command line with: python3 readtemp.py or ...
user avatar
0 votes
2 answers
220 views

Problem opening tkinter script via html page

I am working on this project where I have Raspberry Pi 3 with full Raspbian (with GUI) connected to a 7" screen. I created a Python 3 script: // gui.py import tkinter as tk root = tk.Tk() root....
user avatar
3 votes
1 answer
206 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 ...
user avatar
  • 53
0 votes
0 answers
35 views

SSL connections from PHP fail for a few seconds into the first boot of an older image

I'm distributing a Raspbian based RPi image, which contacts a webserver through PHP and file_get_contents() on startup. The image was created November 2019, the server certificate is newer, from June ...
user avatar
  • 101
0 votes
2 answers
369 views

PHP module is not being installed into /etc/apache2/mods-available

I'm trying to serve a website running Apache2 alongside PHP on my Raspberry Pi 1.3. I have already installed Apache with sudo apt install apache2 -y followed by sudo apt install php libapache2-mod-php ...
user avatar
1 vote
0 answers
43 views

Memory leak using php with dio to read /dev/ttyAMA0

I am using my Raspberry Pi 2 (buster, php 7.4.10) to communicate with an inverter in a small solar system. All the code is functional but it tends to crash/exit after a few hours. Looking at task ...
user avatar
  • 11
0 votes
1 answer
157 views

Why can I run a python script accessed per php file that is accessed per cmd WHILE I can't run the same thing accessed per browser?

Hello ladys and gentlemen :) I got a python script py.py that switches a GPIO (works perfectly when accessing per cmd line). I got a php file php.php in which I access the py.py file (works perfectly ...
user avatar
1 vote
0 answers
18 views

where did the pma__ tables come from when I migrated to new server [closed]

A few months ago, I migrated a PHP application to a new pi. I moved all the scripts and dumped the tables using phpmyadmin export. I then imported the tables in the new server. There were a few ...
user avatar
0 votes
0 answers
95 views

Stream raspi video to php application

I have an PHP Application running on a "server" and my raspberry which is connected to a display is showing this application (chromium). Also on my raspberry is the new hd camera connected ...
user avatar
  • 101
0 votes
2 answers
68 views

How make raspberry pi web controls? [closed]

I want to develop web based control software for the Pi in PHP. I have some experience in PHP , but i have experience in using PHP, but no experience in running it on a Raspberry Pi.
user avatar
0 votes
0 answers
46 views

Pi Access Point - Hostname mapping

I have my IP address mapped to a hostname "example.com" where I have a simple Welcome webpage. The webpage is written in PHP. After I successfully connect to the Pi Access Point I attempt to go to the ...
user avatar
  • 35
0 votes
1 answer
1k views

How to install PHP 7.2?

The title says it all. I'm trying to install PHP7.2 on RPi 3 so I can install OwnCloud on it. When I run sudo apt-get install php7.2 -y I get Unable to locate package php7.2. Do I need to add a repo ...
user avatar
  • 5
1 vote
1 answer
109 views

PHP Install Issue

Does anyone know what would be causing the following error. I have run update and upgrade prior pi@raspberrypi:~ $ sudo apt install apache2 -y sudo: unable to resolve host raspberrypi: Name or ...
user avatar
  • 11
0 votes
0 answers
123 views

php script doesn’t work well when called from html (jquery)

I am creating a web page on a raspberry pi Here is the essence of my html code: <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script ...
user avatar
  • 111
1 vote
3 answers
395 views

Wordpress not working after PHP update

I recently upgraded PHP5.X to PHP7.3 on my Pi 3 and also moved to Raspbian Buster from Jessie. Now I get this message when I try to open the port 80 where I could earlier see my Wordpress site. Your ...
user avatar
  • 398
2 votes
0 answers
2k views

WiFi signal strength in a script

I have a need to obtain WiFi signal strength on a Pi0W. I have a PHP script and all works via terminal: php /var/www/html/blah.php (I use exec("iwconfig wlan0", $output_lines);) The script runs as a ...
user avatar
  • 131
0 votes
0 answers
37 views

Upgraded PHP and not displaying PHP pages

I upgraded my PHP version so I can install some software on my Raspberry Pi. I followed these instructions from Heidi's Lab: In /etc/apt/sources.list change stretch to buster, which is the next-...
user avatar
0 votes
1 answer
2k views

Running a python script from a webserver

I made a Webserver using my Laptop and a few PHP-HTML-Javascript programms. Right now i am able to connect to these pages and everything works just fine. My problem is that i want to run a Python ...
user avatar
4 votes
2 answers
972 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 ...
user avatar
10 votes
1 answer
19k 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 ...
user avatar
  • 219
1 vote
4 answers
155 views

Display html page content before reboot

I have a raspberry with lighttpd and php. Now I want to display webpage content before the raspberry is rebooting when I click on a link. I have create the page below. But when I load the page it isn’...
user avatar
  • 11
3 votes
2 answers
484 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. ...
user avatar
1 vote
0 answers
81 views

Scheduled tasks for GPIO Raspberry Pi on PHP?

I create a web interface for me for manager raspberry pi gpio. Are there libraries for PHP for scheduled tasks for GPIO Raspberry Pi? I want add task from web interface, for example "at 9:00 set ...
user avatar
0 votes
1 answer
319 views

Raspberry | Rasbian update php and apache

I'm using Rasbian VERSION="8 (jessie)" Linux raspberrypi 4.14.73-v7+ which the Apache/2.4.10 PHP 5.6.38-0+deb8u1 has been installed. How can I upgrade the PHP package to PHP 7.3 that is compatible ...
user avatar
0 votes
1 answer
210 views

Raspberri Pi (Raspian) running Apache 2, PhP(7) HTML CSS not running PHP

I am getting very frustrated with trying to track down the source of my problems with the code below. I believe it is something to do with php files not being run. (Note that all files are in the same ...
user avatar
0 votes
0 answers
31 views

POST A CPT IN A CAROUSEL

I am trying to make a dynamic carousel with CPT. My CPT works well and I added some articles but I can not display it. I am doing it this way: <section id="carousel"> <div class="row mb-...
user avatar
  • 1
0 votes
0 answers
154 views

Forwarding owncloud from PI to router

Aim: Have an owncloud on a raspberry, available from public network e.g. from the IP of my router rather than from the IP of my Raspberry. Background info root@DietPi:~# uname -a Linux DietPi 4.19....
user avatar
  • 1
0 votes
1 answer
368 views

RPI Zero as Keyboard: Convert key codes from SHOWKEY to write into /dev/hidg0 HID packet [closed]

I'm using RPI Zero W as keyboard gadget. It's supposed to act as keyboard getaway from Bluetooth keyboard to USB keyboard. I'm running "showkey" shell command process giving me codes of just pressed ...
user avatar
0 votes
1 answer
359 views

MySQL root account unable to create database

I have tried 6 different forum rooms with a similar issue none of the solutions are working out for me. Install MariaDB on my Raspberry Pi, which I am logging in via putty from my windows machine. ...
user avatar
-1 votes
1 answer
111 views

Newcomer to RPi from web developing (HTML/CSS/Javascript). Do I have any advantages? [closed]

I'm looking to get in to the wonderful world of RPi. I can make a website with HTML/CSS/JavaScript/PHP so does that give me any kind of advantage over a true RPi newbie? For my first project I'd like ...
user avatar
2 votes
1 answer
2k views

Cannot install php-curl on raspbian 9.9, dependency issues

When I run: apt-get install php-curl It returns: The following packages have unmet dependencies: php-curl : Depends: php7.3-curl but it is not going to be installed E: Unable to correct problems, ...
user avatar
  • 41
0 votes
0 answers
1k views

php file not executing python script when called through browser

I have an apache2 webserver running on the pi. I have a php file that uses exec() to run a python script. Everything works well from the command line. when loaded through the browser, the exec() ...
user avatar
1 vote
1 answer
2k views

How can I update from PHP 7.0 to PHP 7.1?

My /etc/apt/sources.list file: deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' deb-src http://...
user avatar
-1 votes
1 answer
940 views

Can CodeIgniter be used on an RPi?

Can I use a Raspberry Pi as a web server for a CodeIgniter app? I can't find anything online. I saw tutorials on installing Wordpress but no CodeIgniter...
user avatar
  • 39
1 vote
0 answers
48 views

Raspberry Pi3 not receiving HTTP request from Arduino

I have been running an application on an older original Raspberry Pi. The Raspberry Pi was running Incredible PBX and I have some tables set up in the MySQL database to store data received from an ...
user avatar
0 votes
0 answers
160 views

Get bluetooth button input with php

I'm new to raspberry development but I'm experienced with the web languages (PHP,html5,javascript and css). I want to develop a simple counter that will be increment when the pression of a wireless ...
user avatar
2 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
673 views

Cant install php

I'm kind of new to the linux os and I'm having trouble installing php. i needed a few tools for jasper which alwys show up in the error message. sudo apt-get install php -y Reading package ...
user avatar
0 votes
1 answer
439 views

Printing Python Variables for Debugging

I'm a Python newb so please bear with me if I'm asking a stupid question. I have a RPi3 running Jessie lite. I have Apache and PHP installed. I also have netatalk installed and have mounted my pi e....
user avatar
0 votes
1 answer
831 views

Google Cloud Translation API key environment issue on Raspberry Pi

I am trying to get the Google Cloud Translation API's PHP implementation to work on a Raspberry Pi 3 B+ running Stretch and Nginx with PHP7-FPM. I have created an account at Google and received the ...
user avatar

1
2 3 4 5