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


    /********************************************************************************
     *               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最前面。
  • 相关阅读:
    服务器时间不准导致 com.sun.facelets.impl.DefaultFacelet refresh
    推荐10款来自极客标签的超棒前端特效[第五期] java程序员
    IE10的市场占有率扩充了一倍 java程序员
    固定背景实现的背景滚动特效 java程序员
    支持触摸设备的响应式HTML5音频播放器 AudioPlayer.js java程序员
    WebRTC与Ace在线代码编辑器合作,实现实时协作编程 java程序员
    最流行的JavaScript库,jQuery不再支持IE旧版本 java程序员
    Jquery实现鼠标移上弹出提示框,移出消失 java程序员
    xxx.c: Error: C3065E: type of input file 'xxxx' unknown java程序员
    35+多用途WordPress主题 java程序员
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/5173465.html
Copyright © 2020-2023  润新知