缘由是安装某PHP网盘系统需要curl扩展: 通过php -v查看当前php版本: php -v 版本是是7.0.33 ,所以到官网下载https://www.php.net/distributions/php-7.0.33.tar
缘由是安装某PHP网盘系统需要curl扩展:
通过php -v查看当前php版本:
php -v
版本是是7.0.33 ,所以到官网下载https://www.php.net/distributions/php-7.0.33.tar.gz
解压:
tar -xf php-7.0.33.tar.gz
进入curl目录:
cd php-7.0.33/ext/curl
执行:
phpize
若没安装则执行apt install php7.0-dev安装phpize
然后编译:
./configure --with-curl=/usr/bin/curl --with-php-config=/usr/bin/php-configmake
如果出现
checking for cURL in default path... not found
checking for cURL in multiarch path... not found
./configure: line 4039: curl-dir: No such file or directory
则需要安装:
apt-get install libcurl4-gnutls-dev
然后看到modules目录下生成curl.so
查看ini配置目录以及extension目录:
php -i |grep " Configuration"php -i |grep extension_dir
可以看到
ini配置目录是/etc/php/7.0/cli/php.ini
extension_dir目录是/usr/lib/php/20151012
将动态库拷贝到extension目录:
cp modules/curl.so /usr/lib/php/20151012
在php.ini下的conf.d目录下新建一个10-curl.ini文件,也就是/etc/php/7.0/cli/conf.d/10-curl.ini
内容为:
; configuration for php common module
; priority=10
extension=curl.so
然后重启php或者服务器
然后查看curl模块加载情况:
php -m
此时,再刷新网页即可看到curl扩展已被安装:
来源地址:https://blog.csdn.net/lct408719896/article/details/126045512
--结束END--
本文标题: PHP安装扩展CURL
本文链接: http://www.lsjlt.com/news/420125.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0