doujiurong7210 2017-01-18 07:54
浏览 76
已采纳

litespeed - 致命错误:调用未定义的函数curl_init()

I running litespeed 5.1.11 on my Centos 6.8 VPS (PHP 5.6.29). I use cUrl in my php code. When I run my code with browsing as a web page every thing work fine, but when I run with command it gave me error:
Fatal error: Call to undefined function curl_init()
How can I fix it?

I Compile my php with this configure parameters:

'./configure' '--prefix=/usr/local/lsws/lsphp5' '--disable-fileinfo' '--with-bz2' '--enable-zip' '--with-curl' '--with-mysql' '--with-mysql-sock' '--with-sqlite' '--with-tidy' '--with-xpm-dir' '--enable-pdo' '--with-pdo-sqlite' '--with-pdo-mysql' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-soap' '--with-gettext' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-mcrypt' '--with-mysqli' '--with-openssl' '--with-pic' '--with-png-dir' '--with-zlib' '--with-pcre-regex' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--enable-json' '--with-litespeed'

And cUrl section in phpinfo: phpinfo

  • 写回答

2条回答 默认 最新

  • dongyun234854 2017-01-19 16:07
    关注

    I solve my problem. I should just add this to Configure Parameters.

    '--exec-prefix=/usr' '--with-exec-dir=/usr/bin'

    Now I compile my php with this Configure Parameters:

    --disable-fileinfo --with-bz2 --enable-zip --with-curl --with-mysql --with-mysql-sock --with-sqlite --with-tidy --with-xpm-dir --enable-pdo --with-pdo-sqlite --with-pdo-mysql --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-soap --with-gettext --with-jpeg-dir=/usr --with-kerberos --with-mcrypt --with-mysqli --with-openssl --with-pic --with-png-dir --with-zlib --with-pcre-regex --with-gd --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes --enable-mbstring --with-iconv --enable-exif --enable-ucd-snmp-hack --enable-xml --enable-json --libdir=/usr/lib64 --with-libdir=lib64 --exec-prefix=/usr --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-pcre-regex=/usr --with-gmp --with-layout=GNU --with-system-tzdata --with-apxs2=/usr/sbin/apxs --with-libxml-dir=/usr

    Now, I use /usr/bin/lsphp /my/code.php or php /my/code.php to run my code with command line.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作