Giter Site home page Giter Site logo

tasoftch / php-i2c-extension Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 3.0 39 KB

A Zend Extension for php to grant access to an existing i2c bus on a linux device (Raspberry Pi and for example the ADS1x15)

M4 0.76% C 60.61% PHP 38.64%
i2c-bus raspberry-pi ads1115 ads1015 php-i2c

php-i2c-extension's Issues

Installation

Hello, I am able to get the extension installed and use it to communicate with a DAC module, however, it only works when using the VS Code built-in web server (Debian 10). When I try to use it with Apache, the device fails to load: "Uncaught Error: Call to undefined function i2c_open()..." I noticed that the debugging process is runnint as root whereas the Apache server is running as www-data. I tried changing the owner of /dev/i2c_1 to www-data:www-/*data, but still no joy.

Also, I am not able to install the PHP library with composer. It fails with: "Failed opening required 'tasoft/php-i2c-extension' (include_path='.:/usr/share/php')

I'm not sure how /usr/share/php is involved with this...

i2c_open("/dev/i2c-0") returns false

I installed this software normally and set php.ini. In addition, I have given permissions on /dev/i2c-0.
However, i2c_open("/dev/i2c-0") returns false. Please tell me what you can think of.
If you change i2c.c as follows, it will succeed.

// int fd = open(devPath, O_RDWR);
int fd = open("/dev/i2c-0", O_RDWR);

php 8.1

Hi
When I run make I get a lot of errors and it will not build.
Should this work on php 8.1?
And yes I did install php8.1-dev

Installation

Hello,

Pi 3B+, new install of PHP.
Following the install, when I try to run phpize, it get:
bash: phpize: command not found

And ./configure isn't a file listed.

Any suggestions?

Installation problem, unrecognized option --enable-i2c-php

Thanks for your great Library!

Unfortunately I run into some trouble while trying to install the library,

when I enter the command "./configure --enable-i2c-php" a long list of checks and stuff appears but it also writes

configure: WARNING: unrecognized options: --enable-i2c-php

What causes this problem, what could I do?

Using PHP 7.1 and Raspbian 10 (also tried with PHP7.3)

Edit: it works on PHP 7.3 even with that warning

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.