安装使用php
[下载php7.2.13](http://php.net/downloads.php)
编译安装
./configure‘ ‘--prefix=/usr/local/php‘ ‘--with-config-file-path=/usr/local/php/etc‘ ‘--with-config-file-scan-dir=/usr/local/php/etc/php.d‘ ‘--with-fpm-user=www‘ ‘--with-fpm-group=www‘ ‘--enable-fpm‘ ‘--enable-opcache‘ ‘--disable-fileinfo‘ ‘--enable-mysqlnd‘ ‘--with-mysqli=mysqlnd‘ ‘--with-pdo-mysql=mysqlnd‘ ‘--with-iconv-dir=/usr/local‘ ‘--with-freetype-dir‘ ‘--with-jpeg-dir‘ ‘--with-png-dir‘ ‘--with-zlib‘ ‘--with-libxml-dir=/usr‘ ‘--enable-xml‘ ‘--disable-rpath‘ ‘--enable-bcmath‘ ‘--enable-shmop‘ ‘--enable-exif‘ ‘--enable-sysvsem‘ ‘--enable-inline-optimization‘ ‘--with-curl=/usr/local/curl‘ ‘--enable-mbregex‘ ‘--enable-mbstring‘ ‘--with-password-argon2‘ ‘--with-sodium=/usr/local‘ ‘--with-gd‘ ‘--with-openssl=/usr/local/openssl‘ ‘--with-mhash‘ ‘--enable-pcntl‘ ‘--enable-sockets‘ ‘--with-xmlrpc‘ ‘--enable-ftp‘ ‘--enable-intl‘ ‘--with-xsl‘ ‘--with-gettext‘ ‘--enable-zip‘ ‘--enable-soap‘ ‘--disable-debug‘
make -j 4&& make install
安装ldap扩展模块
先安装openldap
[[email protected] ]# yum install openlda
[[email protected] ]# yum install openldap-devel
如果你是64位,请拷贝相关文件,或创建软链
[[email protected] ]# ln -sv /usr/lib64/libldap* /usr/lib/
然后进入PHP对应版的源码
[[email protected] ext]# pwd
/lnmp/src/php-7.2.13/ext
切换到ldap目录
[[email protected] ext ]# cd ldap/
[[email protected] ldap ]# /usr/local/php/bin/phpize
[[email protected] ldap ]# ./configure --with-php-config=/usr/local/php/bin/php-config
[[email protected] ldap ]# make && make install
最后在php.ini中添加扩展文件
[[email protected] ldap]# vim /usr/local/php/etc/php.ini
extension=ldap.so
#### 重启php 使用 php -m查看模块
[[email protected] ldap]# php -m
原文地址:http://blog.51cto.com/9025736/2347618
时间: 2024-10-12 21:38:25