进入PHP源码目录
cd /opt/php-7.3.16/ext/fileinfo
执行PHP扩展编译预处理指令
/usr/local/php-7.3.16/bin/phpize
... ... ...
编译PHP扩展
./configure --with-php-config=/usr/local/php-7.3.16/bin/php-config
... ... //编译过程略
make
... ... //过程略
make install
Installing shared extensions: /usr/local/php-7.3.16/lib/php/extensions/no-debug-non-zts-20180731/
找到PHP.INI文件,修改extension_dir目录路径为以上so生成路径,并在之后添加so文件:
extension_dir = "/usr/local/php-7.3.16/lib/php/extensions/no-debug-non-zts-20170718/"
extension=fileinfo.so
如果不知道php.ini文件在哪里,可以执行:
php --ini
Configuration File (php.ini) Path: /usr/local/php-7.3.16/lib
Loaded Configuration File: /usr/local/php-7.3.16/lib/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
网友评论