[英]PHP - Unable to load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll
I am having a strange error (system is Ubuntu 16.04): 我有一个奇怪的错误(系统是Ubuntu 16.04):
[Mon Sep 04 13:07:17.219992 2017] [mpm_prefork:notice] [pid 27798] AH00169: caught SIGTERM, shutting down
[Mon Sep 04 13:07:17.302181 2017] [so:warn] [pid 27874] AH01574: module php7_module is already loaded, skipping
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Sep 04 13:07:17.322006 2017] [mpm_prefork:notice] [pid 27875] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Sep 04 13:07:17.322026 2017] [core:notice] [pid 27875] AH00094: Command line: '/usr/sbin/apache2'
PHP version is 7.1.19. PHP版本是7.1.19。 I installed curl (apt-get install php7.1-curl), in the php.ini I added extension=curl.co (and commented out extension=php_curl.dll ), restarted the apache service, and the error is still there (I tried commenting out extension=curl.co but the error is still there).
我安装了curl(apt-get install php7.1-curl),在php.ini中我添加了extension = curl.co (并注释掉了extension = php_curl.dll ),重新启动了apache服务,错误仍然存在(我尝试评论扩展= curl.co但错误仍然存在)。
This is an error I am getting on the page (Laravel setup): 这是我在页面上出现的错误(Laravel设置):
Call to undefined function App\curl_init()
Everything is installed and config files are as required and I don't know what could be wrong here. 一切都已安装,配置文件是必需的,我不知道这里有什么问题。
The /etc/php/7.1/mods-available/curl.ini
file content should be: /etc/php/7.1/mods-available/curl.ini
文件内容应该是:
extension=curl.so
Please notice the extension is .so
, and not .co
. 请注意扩展名是
.so
,而不是.co
。
Then you can enable the module in your PHP by running: 然后,您可以通过运行以下命令在PHP中启用该模块:
$ sudo phpenmod curl
Finally, you may need to restart your Apache: 最后,您可能需要重新启动Apache:
$ sudo systemctl restart apache2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.