美文网首页
编译php的mysql.so文件

编译php的mysql.so文件

作者: AMZ小楼 | 来源:发表于2018-08-22 08:08 被阅读0次
    sbin/php-fpm -y etc/php-fpm.conf -c etc/php.ini
    kill 10856
    
    
    ./bin/php -m
    ./configure \
    --prefix=/usr/local/php2 \
    --enable-fpm \
    --with-config-file-path=/usr/local/php2/etc  \
    --with-libxml-dir \
    --with-gd \
    --with-jpeg-dir \
    --with-png-dir \
    --with-freetype-dir \
    --with-iconv-dir \
    --with-zlib-dir \
    --with-bz2 \
    --with-openssl \
    --with-mcrypt \
    --enable-soap \
    --enable-gd-native-ttf \
    --enable-mbstring \
    --enable-sockets \
    --enable-exif \
    --disable-ipv6
    
    make
    make install
    /usr/local/php2/bin/phpize
    ./configure --with-php-config=/usr/local/php2/bin/php-config --with-mysql=/usr/local/mysql/
    make
    make install
    
    http.conf 解析php文件
    LoadModule php5_module     modules/libphp5.so
    DirectoryIndex index.php
    AddType application/x-httpd-php .php
    
    http.conf 加载 php.ini配置
    
    PHPIniDir /usr/local/php2/etc/php.ini
    
    php.ini
    extension=/usr/local/php2/lib/php/extensions/no-debug-non-zts-20100525/mysql.so
    ;
    ; ... or with a path:
    ;
    ;extension_dir=/usr/local/php/lib/php/extensions//usr/local/php/lib/php/extensions/no-debug-non-zts-20100525
    extension=/usr/local/php2/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so
    
    用apache 查看php加载了哪些库 php -m
    showdoc 连接数据库需要加载 pdo_mysql.so 动态库
    index.php
    <?php
    phpinfo();
    ?>
    

    相关文章

      网友评论

          本文标题:编译php的mysql.so文件

          本文链接:https://www.haomeiwen.com/subject/kxceiftx.html