Page 1 of 1

Using PHP to control SPI devices

Posted: Wed Sep 05, 2012 4:46 pm
by frak
I have made a PHP extension that provides an object oriented interface to the SPI devices. To build the extension, you will need to have php5-dev installed, and the instructions in the README should guide you through the install process. The repository can be found here

https://github.com/frak/php_spi

The inspiration for this project was to be able to replicate the software used in this project: http://learn.adafruit.com/light-paintin ... i/software in PHP as that is where my skills lie. I hope that this extension will prove useful to other PHP developers working with a Pi out there...

Re: Using PHP to control SPI devices

Posted: Mon Mar 11, 2013 2:58 pm
by PHMJS
Hi Frak,

I really want to use your PHP extension but I'm getting stuck on
$ ./phpize
$ ./configure --enable--spi
$ make
$ make test
$ sudo make install

Can you explain it further? Getting now a "No such file or directory" error.

Thanks in advance!

Re: Using PHP to control SPI devices

Posted: Sat May 11, 2013 1:24 pm
by alexszilagyi
Hi @Frak,

I can confirm as @PHMJS replied to your post that I'm stuck at the same step. Could you please give details how to install?

Can you tell us where you run these commands?

Code: Select all

$ ./phpize
$ ./configure --enable--spi
$ make
$ make test
$ sudo make install
Read on other blog sites / forums that phpize is installed on /usr/bin/ but I'm not able to enter to that folder
As you might see in below terminal there are two folders but I'm not sure how to install it.



Image

Re: Using PHP to control SPI devices

Posted: Thu Aug 15, 2013 3:54 pm
by scottie2212
For anyone who is still having a problem with phpize...

I used ...
$ cd ~/php_spi
and then
$ /usr/bin/phpize
I encountered a problem with $ make test but $ sudo make install appeared to work.

Hope this is of some help.

Re: Using PHP to control SPI devices

Posted: Thu Nov 15, 2018 9:26 pm
by SkydiveMarius
In the meanwhile there was some development on this topic in the PHP world.
You have now the following possibilities:
  • Using the berry-spi extension for native communication (linked against the C interface of Pigpio)