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.
136 3
sqlite3.OperationalError: no such function: JSON_VALID
sqlite3.OperationalError: no such function: JSON_VALID
150 0
busybox filesystem add ldd function
/******************************************************************** * busybox filesystem add ldd function * 声明: * 本文主要是为了解决缪新建提出的查看程序涉及到动态链接库的问题。
2082 0
|
Web App开发 编解码 网络安全
Texas Instruments matrix-gui-2.0 hacking -- json.txt
{ "main_menu": { "apps": [ { "Name":"Profiling", "Order":"1", "Icon":"apps\/images\/oprofile-icon.
931 0
|
8月前
|
人工智能 Python
083_类_对象_成员方法_method_函数_function_isinstance
本内容主要讲解Python中的数据类型与面向对象基础。回顾了变量类型(如字符串`str`和整型`int`)及其相互转换,探讨了加法在不同类型中的表现。通过超市商品分类比喻,引出“类型”概念,并深入解析类(class)与对象(object)的关系,例如具体橘子是橘子类的实例。还介绍了`isinstance`函数判断类型、`type`与`help`探索类型属性,以及`str`和`int`的不同方法。最终总结类是抽象类型,对象是其实例,不同类型的对象有独特运算和方法,为后续学习埋下伏笔。
172 7
083_类_对象_成员方法_method_函数_function_isinstance
|
8月前
|
Python
[oeasy]python086方法_method_函数_function_区别
本文详细解析了Python中方法(method)与函数(function)的区别。通过回顾列表操作如`append`,以及随机模块的使用,介绍了方法作为类的成员需要通过实例调用的特点。对比内建函数如`print`和`input`,它们无需对象即可直接调用。总结指出方法需基于对象调用且包含`self`参数,而函数独立存在无需`self`。最后提供了学习资源链接,方便进一步探索。
203 17
|
8月前
|
人工智能 Python
[oeasy]python083_类_对象_成员方法_method_函数_function_isinstance
本文介绍了Python中类、对象、成员方法及函数的概念。通过超市商品分类的例子,形象地解释了“类型”的概念,如整型(int)和字符串(str)是两种不同的数据类型。整型对象支持数字求和,字符串对象支持拼接。使用`isinstance`函数可以判断对象是否属于特定类型,例如判断变量是否为整型。此外,还探讨了面向对象编程(OOP)与面向过程编程的区别,并简要介绍了`type`和`help`函数的用法。最后总结指出,不同类型的对象有不同的运算和方法,如字符串有`find`和`index`方法,而整型没有。更多内容可参考文末提供的蓝桥、GitHub和Gitee链接。
211 11
|
JavaScript
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新特性,与传统函数相比,它有更简洁的语法,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。箭头函数不适用于构造函数,不能使用new关键字调用。
|
数据可视化 开发者 索引
详解Wireshark LUA插件函数:function p_myproto.dissector(buffer, pinfo, tree)
在 Wireshark 中,LUA 插件通过 `function p_myproto.dissector(buffer, pinfo, tree)` 扩展协议解析能力,解析自定义应用层协议。参数 `buffer` 是 `PacketBuffer` 类型,表示原始数据包内容;`pinfo` 是 `ProtoInfo` 类型,包含数据包元信息(如 IP 地址、协议类型等);`tree` 是
605 1