• ubuntu 编译安装php5扩展


    已安装过apache2和mysql5.7的ubuntu系统,
    补充安装php扩展,gd.so、mysql.so、pdo_mysql.so

    # download php-5.6.50
    wget http://mirrors.sohu.com/php/php-5.6.40.tar.bz2
    tar jxvf php-5.6.40.tar.bz2
    cd php-5.6.40/ext/
    ext_path=$(pwd)
    ln -s $ext_path $ext_path/pdo_mysql/
    ln -s $ext_path $ext_path/mysql/
    apt install autoconf -y
    
    # install gd.so
    cd gd
    apt install libpng-dev
    /usr/local/php/bin/phpize
    ./configure --with-php-config=/usr/local/php/bin/php-config
    make
    make install
    sed -i "911 a extension=gd.so" /usr/local/php/lib/php.ini
    /usr/local/apache2/bin/apachectl -k restart
    cd ..
    
    # install libmsyql
    cd mysql
    /usr/local/php/bin/phpize
    ./configure 
    	--with-php-config=/usr/local/php/bin/php-config 
    	--with-mysql=mysqlnd
    
    make
    make install
    sed -i "911 a extension=mysql.so" /usr/local/php/lib/php.ini
    /usr/local/apache2/bin/apachectl -k restart
    cd ..
    
    # install pdo_mysql
    cd pdo_mysql
    /usr/local/php/bin/phpize
    ./configure 
    	--with-php-config=/usr/local/php/bin/php-config 
    	--with-mysql=mysqlnd
    
    make 
    make install
    sed -i "911 a extensionn=pdo_mysql.so" /usr/local/php/lib/php.ini
    /usr/local/apache2/bin/apachectl -k restart
    cd ..
    
    cd ../../
    rm -rf php-5.6.40*
    
    有了计划记得推动,不要原地踏步。
  • 相关阅读:
    [WC2010]重建计划
    [POJ1741]Tree
    [NOI2008]志愿者招募
    [BZOJ2127]happiness
    「网络流 24 题」太空飞行计划
    [TJOI2015]线性代数
    [HDU2874]Connections between cities
    [POI2007]ZAP-Queries
    [SCOI2010]幸运数字
    POJ 2826 An Easy Problem?!
  • 原文地址:https://www.cnblogs.com/amnotgcs/p/14150488.html
Copyright © 2020-2023  润新知