Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dl() is deprecated an deleted on some SAPIs #9

Open
chrboe opened this issue Mar 20, 2014 · 7 comments
Open

dl() is deprecated an deleted on some SAPIs #9

chrboe opened this issue Mar 20, 2014 · 7 comments

Comments

@chrboe
Copy link

chrboe commented Mar 20, 2014

You shouldn't use dl() in your wiringpi.php script because it is deprecated. On my system, for instance, the script is unable to load the library because dl() is disabled.

@Gadgetoid
Copy link
Member

I noticed this recently. However wiringpi.php is generated by SWIG and can't be changed directly. However dl() is only a fallback for if the library is not already loaded via php.ini, so it shouldn't really be encountered.

@earlvanze
Copy link

On this note, using PHP 5.6.4, doing include("wiringpi.php"); fails because this needs to be commented out:

/* // Try to load our extension if it's not already loaded. if (!extension_loaded('wiringpi')) { if (strtolower(substr(PHP_OS, 0, 3)) === 'win') { if (!dl('php_wiringpi.dll')) return; } else { // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'. if (PHP_SHLIB_SUFFIX === 'dylib') { if (!dl('wiringpi.so')) return; } else { if (!dl('wiringpi.'.PHP_SHLIB_SUFFIX)) return; } } } */

@javigf
Copy link

javigf commented Apr 25, 2016

Hi, which would is the solution to it ? Sorry i am a newie on this. Thanks

@earlvanze
Copy link

I have no idea, I can't get the extension to work on PHP 5.5.33 or 5.6.4 still.

@Gadgetoid
Copy link
Member

You'd need to place the wiringpi.so into an appropriate PHP extensions dir and load it in php.ini, I got it up and running recently but I'm not a regular PHP user so I had to puzzle out what I was doing. I'll try to replicate and produce a guide.

@earlvanze
Copy link

I did that, of course. Loaded the extension in php.ini as well as instructed. Doesn't work in PHP 5.5.33 or 5.6.4. What version of PHP are you using?

@AdAerts
Copy link

AdAerts commented Sep 19, 2016

I included the generated wiringpi.so as an extension in php.ini, but apache's error log gives:
H00169: caught SIGTERM, shutting down
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/wiringpi.so' - /usr/lib
/php5/20131226/wiringpi.so: undefined symbol: serialPutchar in Unknown on line 0

If I check the source code, there should be a serialPutchar function. Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants