PHP CURL 启用 Linux [英] PHP CURL Enable Linux

查看:30
本文介绍了PHP CURL 启用 Linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些 php 脚本,它们一直在 Windows 机器上的 Apache 服务器上运行.这些脚本使用在 php 中默认未启用的 curl.对于 Windows 启用,它很容易并且在 php.ini 文件中使用 curl .dll 文件取消注释行.好吧,因为 Linux 使用 .so 而不是无法工作的 .dll 文件.

I have some php scripts that I've been running on an Apache server on a windows machine. These scripts use curl which isn't enabled by default in php. For windows enabling it was as easy and un-commenting the line with the curl .dll file in the php.ini file. Well since Linux uses .so instead of .dll files that wont work.

有谁知道如何在 Linux 机器上运行的 Apache 服务器上启用 curl?Php 已经安装,所以我真的希望有一个不涉及重新安装 php 的解决方案.提前致谢!

Does anyone have any idea how to enable curl on an Apache server running on a Linux machine? Php is already installed so I'm really hoping for a solution that doesn't involve re-installing php. Thanks in advance!

机器安装了openSUSE v11.3 版本的linux.我没有设置机器,而是通过命令行(腻子)与它进行交互.任何帮助都会很棒.

The machine has the openSUSE v11.3 version of linux installed. I'm didn't setup the machine and am interacting with it over command line(putty). Any help would be great.

推荐答案

如果其他人像我一样从 google 偶然发现此页面:

If anyone else stumbles onto this page from google like I did:

使用 putty (putty.exe) 登录您的服务器并使用以下命令安装 curl :

use putty (putty.exe) to sign into your server and install curl using this command :

    sudo apt-get install php5-curl

确保在 php.ini 文件中启用了 curl.对我来说,它在 /etc/php5/apache2/php.ini 中,如果找不到,这一行可能在 /etc/php5/conf.d/curl.ini 中.确保该行:

Make sure curl is enabled in the php.ini file. For me it's in /etc/php5/apache2/php.ini, if you can't find it, this line might be in /etc/php5/conf.d/curl.ini. Make sure the line :

    extension=curl.so

没有被注释掉然后重启apache,在putty中输入:

is not commented out then restart apache, so type this into putty:

    sudo /etc/init.d/apache2 restart

安装信息来自 https://askubuntu.com/questions/9293/how-do-i-install-curl-in-php5,检查它是否有效,此堆栈溢出可能对您有所帮助:检测 cURL 是否有效?

Info for install from https://askubuntu.com/questions/9293/how-do-i-install-curl-in-php5, to check if it works this stack overflow might help you: Detect if cURL works?

这篇关于PHP CURL 启用 Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆