zoukankan      html  css  js  c++  java
  • php环境配置

    下载php源代码

    cd /usr/local/src
    wget http://cn2.php.net/get/php-5.6.24.tar.gz/from/this/mirror
    mv mirror php-5.6.24.tar.gz
    tar -zxvf php-5.6.24.tar.gz
    cd php-5.6.24

    安装依赖的组件

    xml扩展

    apt-get install libxml2-dev gcc make

    png扩展

    apt-get install libpng12-dev

    freetype扩展

    apt-get -y install libfreetype6-dev

    openssl扩展

    apt-get install openssl
    apt-get install libcurl3-openssl-dev

    jpeg扩展

    apt-get install libjpeg-dev

    编译语句

    生成配置文件

    ./configure --prefix=/opt/php --with-config-file-path=/opt/php/lib --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl-dir=/usr --with-openssl --with-pdo-mysql=mysqlnd --with-pear --enable-sockets --with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli
    

    安装了依赖的组件以后,应该就不会报错,如果报错请安装缺少的组件,然后重新生成配置文件。

    编译&安装

    make -j 4&& make install

    查看php服务器配置

    当我们迁移服务器的时候,上述生成配置文件的代码需要与原php服务器的一直,我们可以使用php-config --configure-options查看。

    php-config的位置在 php/bin/php-config

    没有发现php.ini?

    直接编译安装php之后,是没有php.ini的,我们可以从解压缩后的目录copy到/opt/php/lib,然后进行配置生效。

    /opt/php/lib是在./configure中配置的路径

    find / -name php       一般在opt下的那个

    php -v   查看版本号

    创建软连接:ln /opt/php/bin/php /bin

  • 相关阅读:
    luogu P1833 樱花 看成混合背包
    luogu P1077 摆花 基础记数dp
    luogu P1095 守望者的逃离 经典dp
    Even Subset Sum Problem CodeForces
    Maximum White Subtree CodeForces
    Sleeping Schedule CodeForces
    Bombs CodeForces
    病毒侵袭持续中 HDU
    病毒侵袭 HDU
    Educational Codeforces Round 35 (Rated for Div. 2)
  • 原文地址:https://www.cnblogs.com/xingyunfashi/p/9415872.html
Copyright © 2011-2022 走看看