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

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

问题描述

我有一些PHP脚本,我一直在Windows机器上的Apache服务器上运行。这些脚本使用curl,它在php中默认不启用。对于Windows启用它是一样容易,并解除与curl .dll文件在php.ini文件中的行注释。因为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。我没有设置机器,并通过命令行(putty)与它交互。任何帮助将是巨大的。

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.

推荐答案

如果任何人从谷歌绊倒这个页面,像我一样:

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

http://askubuntu.com/questions/9293/how-do-i-install- curl-in-php5 ,以检查其是否工作此堆栈溢出可能会帮助您:检测if cURL是否有效?

Info for install from http://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天全站免登陆