busybox filesystem matrix-gui-2.0 undefined function json_encode()

简介: /******************************************************************************** * matrix-gui-2.
/********************************************************************************
 *               matrix-gui-2.0 undefined function json_encode() 
 * 声明:
 *     本文解决matrix-gui-2.0中遇到的:
 *     Fatal error: 
 *     Call to undefined function json_encode() in /www/generate.php on line 134
 *     以及busybox httpd找不到index.html,主要是由于index.html被替换成了index.php
 *
 *                                          2016-1-31 深圳 南山平山村 曾剑锋
 *******************************************************************************/


一、参考文章:
    1. PHP移植
        http://www.cnblogs.com/dancheblog/p/3508675.html
    2. Ubuntu Correct path to libxml2 when configuring PHP 5
        https://www.howtoforge.com/community/threads/ubuntu-correct-path-to-libxml2-when-configuring-php-5.9982/
    3. 编译安装php
        http://www.cnblogs.com/alexqdh/archive/2012/11/20/2776017.html
    4. linux下安装PHP出现错误 求助大家了
        http://bbs.chinaunix.net/thread-1962843-1-1.html
    5. Using the busybox HTTP server
        http://wiki.chumby.com/index.php?title=Using_the_busybox_HTTP_server

二、下载、编译libxml2-2.7.6.tar.gz
    1. https://buildroot.org/downloads/
    2. sudo ./configure --host=arm-linux-gnueabihf --prefix=/usr/local/php && make && make install
    3. 注意配置好编译器环境变量。

三、 下载、编译zlib-1.2.8.tar.gz
    1. http://www.zlib.net/
    2. sudo CC=arm-linux-gnueabihf-gcc ./configure --shared --prefix=/usr/local/php && make && make install
    3. 注意配置好编译器环境变量。

四、重新编译php-5.5.31.tar.bz2
    ./configure --host=arm-linux-gnueabihf --prefix=/usr/local/php --disable-all --enable-fastcgi --enable-session --enable-tokenizer --enable-pdo --with-sqlite --with-sqlite3 --with-pdo-sqlite --with-pcre-regex  --without-iconv --with-libxml-dir=/usr/local/php --enable-libxml --enable-spl --enable-simplexml --enable-json --with-zlib --with-zlib-dir=/usr/local/php
    
五、error:
    1. 错误1:
        1. 错误现象:
            ......
            checking whether to enable LIBXML support... yes
            checking libxml2 install dir... no
            checking for xml2-config path... (cached) /usr/bin/xml2-config
            configure: error: xml2-config not found. Please check your libxml2 installation.
        2. 解决办法:
            1. 编译安装:libxml2-2.7.6.tar.gz
            2. php-5.5.31加入编译条件(目录根据自己前面编译libxml是写的目录):
                --enable-libxml --with-libxml-dir=/home/Qt/rootfs/busybox/php/libxml2-2.7.6
    2. 错误2:
        1. 错误现象:
            ......
            checking for strftime... (cached) yes
            checking which regex library to use... php
            checking whether to enable LIBXML support... yes
            checking libxml2 install dir... /home/Qt/rootfs/busybox/php/libxml2-2.7.6
            checking for xml2-config path... 
            configure: error: xml2-config not found. Please check your libxml2 installation.
        2. 解决办法:“
            sudo apt-get install libxml2-dev
    3. 错误3:
        1. 错误现象:
            ......
            checking whether to enable the SQLite3 extension... yes
            checking bundled sqlite3 library... yes
            checking for ZLIB support... yes
            checking if the location of ZLIB install directory is defined... no
            checking for zlib version >= 1.2.0.4... 1.2.3.4
            checking for gzgets in -lz... no
            configure: error: ZLIB extension requires gzgets in zlib
        2. 解决办法:
            1. 编译安装:zlib-1.2.8.tar.gz
            2. php-5.5.31加入编译条件(目录根据自己前面编译zlib是写的目录):
                --with-zlib --with-zlib-dir=/usr/local/php

六、matrix_gui 404 找不到index.html:
    1. 这可能是由于busybox的httpd默认识别的index.html,但我们的是index.php;
    2. 由上可知,我们需要在matrix_gui中指定我们需要访问的是index.php;
    3. 当然,我们也是可以在/etc/httpd.conf配置:
        I:index.php      # Show index.php when a directory is requested
    
七、总结:
    zlib最好要先于libxml2编译,同时在编译libxml2的时候将zlib的安装目录放置于PATH最前面。

 

目录
相关文章
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
210 3
sqlite3.OperationalError: no such function: JSON_VALID
sqlite3.OperationalError: no such function: JSON_VALID
207 0
busybox filesystem add ldd function
/******************************************************************** * busybox filesystem add ldd function * 声明: * 本文主要是为了解决缪新建提出的查看程序涉及到动态链接库的问题。
2160 0
|
Web App开发 编解码 网络安全
Texas Instruments matrix-gui-2.0 hacking -- json.txt
{ "main_menu": { "apps": [ { "Name":"Profiling", "Order":"1", "Icon":"apps\/images\/oprofile-icon.
970 0
|
8月前
|
机器学习/深度学习 JSON 监控
淘宝拍立淘按图搜索与商品详情API的JSON数据返回详解
通过调用taobao.item.get接口,获取商品标题、价格、销量、SKU、图片、属性、促销信息等全量数据。
|
7月前
|
JSON API 数据格式
淘宝拍立淘按图搜索API系列,json数据返回
淘宝拍立淘按图搜索API系列通过图像识别技术实现商品搜索功能,调用后返回的JSON数据包含商品标题、图片链接、价格、销量、相似度评分等核心字段,支持分页和详细商品信息展示。以下是该API接口返回的JSON数据示例及详细解析:
|
7月前
|
JSON 算法 API
Python采集淘宝商品评论API接口及JSON数据返回全程指南
Python采集淘宝商品评论API接口及JSON数据返回全程指南
|
7月前
|
JSON API 数据安全/隐私保护
Python采集淘宝拍立淘按图搜索API接口及JSON数据返回全流程指南
通过以上流程,可实现淘宝拍立淘按图搜索的完整调用链路,并获取结构化的JSON商品数据,支撑电商比价、智能推荐等业务场景。
|
8月前
|
JSON 缓存 自然语言处理
多语言实时数据微店商品详情API:技术实现与JSON数据解析指南
通过以上技术实现与解析指南,开发者可高效构建支持多语言的实时商品详情系统,满足全球化电商场景需求。
|
8月前
|
JSON API 数据格式
干货满满!淘宝商品详情数据,淘宝API(json数据返回)
淘宝商品详情 API 接口(如 taobao.item.get)的 JSON 数据返回示例如下