如何在Amazon EC2免费套餐上启用cURL扩展

I am currently trying to enable cURL on my EC2 server (free tier).

I have installed php5_curl and I am able to run curl through php via SSH.

I am using the following file to see whether cURL has been installed correctly.

testCurl.php

<?php
    function _iscurlsupported() {
            if (in_array ('curl', get_loaded_extensions())) {
                return true;
            }
            else {
                return false;
            }
    }

    if (_iscurlsupported()) {
            echo "cURL is supported
";
    }
    else {
            echo "cURL isn't supported
";
    }
?>

The command via ssh: php testCurl.php displays that curl is supported. The command when I access it through a brower displays that curl ISN'T supported.

I have checked the php.ini file located in php5/apache2 (the php.ini file that the browser loads (tested through another script)) and the extension is no where to be found.

I have checked the "extensions_dir" directory located on my server and the curl.so file is located there.

I am unsure why I am unable to run curl when accessing my script via the browser.

Any help would be greatly appreciated.

Cheers, jt234

Note: If you require any more information please ask. My problem is similar (if not the same as) Unable to use PHP curl on amazon ec2 free tier but the issue hasn't been resolved.

查看全部
duankang5882
duankang5882
2012/09/05 04:05
  • curl
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复