arduino / openwrt-yun

A custom version of OpenWrt, targeted to the Arduino Yún
GNU General Public License v2.0
147 stars 71 forks source link

PHP7 cURL extension issues (and how I fixed it) #51

Open atchoo78 opened 4 years ago

atchoo78 commented 4 years ago

First of all, I didn't know where else to write this. I just wanted to share this, as I'm sure someone else must have run into this particular problem:

I finally managed to get PHP7 up and running on my Yun Rev.2 with most of the available (from opkg) extensions.

Whenever I tried to load a PHP page (with some cURL code in it), from the web browser, I got a "call to undefined function: curl_init();" error message. So after experimenting for a loooong time, I suddenly thought it would be worth a shot to run the php script from php-cli, instead. Lo and behold, it was:


root@yun:/mnt/sda1/arduino/www/current_noserver# php-cli curltest.php

**  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/curl.so' - Error loading shared library libmbedcrypto.so.0: No such file or directory (needed by /usr/lib/php/curl.so) in Unknown on line 0 **

I discovered that there was a file named libmbedcrypto.so.1 (instead of 0) in /usr/lib. So I applied this quick-trick-fix, as suggested (only slightly modifed) on this page:

ln -s /usr/lib/libmbedcrypto.so.1 /usr/lib/libmbedcrypto.so.0

and

/etc/init.d/uhttpd restart

At last all of the extensions clicked into place, and I now have an (amazingly fast!) working and wifi connected wireless hardware/button-controlled web/PHP server. That's truly awesome...

Hope this helps someone. At least that was my intention for writing this, but I'm aware this may not be the right place to post this.

Andreas

nsmith1024 commented 3 years ago

Hello anybody knows the github link tot the full repository of OpenWRT for Arduino YUN for the rev-2 board so i can build that OpenWRT myself from scratch?

Thanks