Hot answers tagged

10

These are the steps you can follow. Grab latest source from this site. (http://php.net/downloads.php) Choose your nearest mirror. For example, I did "wget http://in1.php.net/distributions/php-5.6.10.tar.bz2" Unpack it: tar -xvjf php-5.6.10.tar.bz2 cd php-5.6.10 ./configure make -j4 (if you're compiling it on Rpi 2) else just make sudo make install Test it ...


8

The package php7.1 isn't in the stretch repo, but it is in the buster and sid repositories (for Debian 10 and unstable, respectively). You should be able to just change stretch to buster, and then run: $ [sudo] apt-get install php7.1 You may find it helpful to upgrade your system as recommended in the Debian documentation when doing this using apt-get ...


7

You need to install "php5-cli": sudo apt-get install php5-cli After that, you will have a php binary to run in your path. You can see where it is with: which php


7

In terms of networking, this is certainly possible. Any WIFI access point can provide WIFI access to other devices. A WIFI accesspoint typically also acts as a DHCP server giving out IP addresses and DNS configuration, and also as a gateway, routing traffic to other networks, notably the internet. A WIFI accesspoint with no connection to internet will not be ...


6

You can call the php Script using python's os.system: import os value = 992.23 os.system("php /path/to/your/file.php %s"%(value)) in you php file, just specify the value as given per command line: 'value' => $argv[1],


6

But this is doing nothing, it's not rebooting or shutting down using this code. If you are using apache, it runs as its own user and does not have permission to run reboot with sudo. To do that, you have to edit /etc/sudoers (as root) and add a line: apache ALL = NOPASSWD: /sbin/reboot, /sbin/halt That's presuming the user name is apache -- I'm not sure ...


6

/var/log/messages or maybe nowhere. Two things to try $ ls -lrt /var/log # find the most recently written logfile $ cat /etc/syslog.conf # view the syslog configuration


6

when raspberry pi 3 handles 10 Thousand connection Very, very unlikely. If each connection were generating 1 KB/s of traffic, that's 10 MB/s, which is just within the 12 MB/s theoretical upper limit of the 100 Mbps ethernet NIC. But I don't see how a 4 x 1.2 Ghz processor is going to be able to do much with that volume of information, besides maybe turn it ...


5

sudo python /var/www/red_on.py most probably asks for a sudo password, which is not provided anywhere, and the command fails. you may try echo <password> | sudo -S ..., however I haven't checked if output redirect works well in the PHP exec().


5

At the time of this writing (november 2015), raspbian is built on Debian Jessie. The installable PHP version is in the 5.6 branch. However, for Laravel projects you will need a number of PHP extensions. Most of these are available in the Raspbian repositories (or out of the box), but the php_mbstring extension cannot be loaded via apt-get. Instead, to ...


4

Remove the FORM element completely (as the markup from exmaple doesn't even conform to HTML specifications). So it looks something like this, in its simplest form. <head> //Import jquery here </head> <html> <img src= "http://192.168.15.22:8081/?action=stream" width="800" height="460"/> <input id="left_button" type="button"...


4

The command sudo python XYZ will be execute as the apache user. You'll need to add this user to your sudoers file. sudo echo "apache ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers Replace "apache" with your systems apache username (may be "www-data", "httpd" or "www" on some systems.) Suggestion Why use Apache or PHP at all? SimpleHTTPServer is extremely ...


4

This works for me <?php system("hostname -I"); ?>


4

You can install and run piControl, a Node.js web application to shut down or reboot your Raspberry Pi. More info here. To make your Raspberry Pi reachable from the Internet, you should give it a static IP address on your local network, and forward the public HTTP default port (80) to the local IP address of the Raspberry Pi.


4

As a beginner it may seem a bit taunting on how to actually transfer data, or how to ask the correct question on how to do it. The reason is because there are so many ways to do. A popular way to be run a simple webserver on your "server". You can choose any language you like to run this simple webserver, python, node.js or C# MVC with API. On the node, ...


3

exec() is potentially insecure, because it can execute any command on your system that the PHP process has permission to run. The key to using it securely is to ensure that the command you send to exec() never contains direct user input. Your example code is insecure because $command depends on unfiltered user input from $_POST via $r. Although $r is only ...


3

Always run sudo apt-get update first before installing / upgrading as that will ensure you are getting the newest packages / package locations. 404 errors are commonly because packages are no longer available as new ones have replaced them, or you aren't connected to the internet. But as you can ping google.com, that rules out internet connectivity issues. ...


3

If you find your apache web service is unable to run the raspistill command you may need to modify the www-data apache user to allow it to run the command: echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules and this one usermod -a -G video www-data


3

First run this command (you may have already done this but lets be sure): sudo apt-get install php5-mysql then restart Apache (which I think is the actual cause of your problem), by doing: sudo /etc/init.d/apache2 restart.


3

Check your paths to the scripts. It would look like your paths need to be changed from sudo python var/www/gpio/off.py to sudo python /var/www/gpio/off.py


3

Your card reader is a usb card reader that acs like a keyboard and spits out the value as if keys were being pressed. It looks as if you should be able to use the fgetc()function in php to get keyboard input from the keyboard. Assuming your usb card reader gives an enter key when you scan a card the you should be able to take that usb card reader. ...


3

Title suggests compilation, but your last question just concerns a successful installation. If you're using Raspbian - which is generally a Debian distribution you can just search for existing .deb files for PHP7. I use `Jessie' version on my rpis, which has available compiled packages: https://www.dotdeb.org/2015/12/04/php-7-0-0-is-available-for-jessie/ for ...


3

Looking at your sources.list file your problem may be that you are only using "Wheezy" {Debian/Raspian Version 7.x "OldStable"} sources but also have "jessie" {Debian/Raspian Version 8.x "Stable"} sources commented out - if you have previous had the latter uncommented you may have installed packages from the later version ones and then, when they were ...


3

You have an HDMI output from the camera that supplies clean HDMI, so you need to convert that to an input format for the Rpi. I don't have a good way to do this, but I think you'll discover that you run into another problem fairly quickly. The live video feed from DSLRs turns off after about 30 minutes with no activity (button presses, recording, etc.). I ...


3

i used sudo apt-get install php5 libapache2-mod-php5 -y it works ok for me


2

Two's complement is a means of representing negative numbers in binary, using one bit to indicate positive or negative. We called these signed numbers since they have a sign, + or -. Unsigned numbers are always positive. So where a 16-bit "unsigned" number has the range 0 to 65535 (2^16), a 16-bit "signed" number in two's complement has the range -32768 to ...


2

OK, I had the same problems, so here were the things which helped me: Go to /etc/apache2, and in the file envvars, change login, and user group to pi, or the user you are using. (P.S. This thing is really bad for website security, if you plan to publish the website, you will need to play around with user groups!). By doing that you are changing the user ...


2

Here's a sample script to read an sqlite3 database using Python: import sqlite3 conn = sqlite3.connect('example.db') c = conn.cursor() for row in c.execute('SELECT * FROM led'): print row Check out the documentation, it's pretty good.


2

Following Gerben's comment on the question, one way to make that would be implementing a Message Broker and have a client poll for messages from a server with a known and static address (or a DNS entry that follows a dynamic address). I suggest taking a look at RabbitMQ. There is also a tutorial on how to install it in the Pi. Consider that the server will ...


2

You could use a ram disk if the point is to stop SD card wear and tear. E.g. sudo mkdir /ram # create mount point (a one off command) sudo mount -osize=100m tmpfs /ram -t tmpfs # create ram disk at each boot This will create a 100 MB ram disk accessible at /ram. Save your photos to /ram, upload, delete. No SD card wear and tear.


Only top voted, non community-wiki answers of a minimum length are eligible