• Resolved Copywrite

    (@copywrite2012)


    Hi all,
    I get an error trying to check if my server has cURL installed I created a file and uploaded it via ftp to mydomain.com/no.php
    I have wordpress installed on my domain accessable via mydomain.com

    What does this error mean? Thank you

    Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in /home/yoursite/public_html/no.php on line 12

    <?php
    
        function _iscurlsupported() {
        if  (in_array  (‘curl’, get_loaded_extensions())) {
        return true;
        }
        else{
        return false;
        }
        }
    
        if (_iscurlsupported()) echo “cURL is supported”; else echo “cURL is NOT supported”;
    
        ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Try:

    <?php
    function _iscurlsupported() {
        if  (in_array  ('curl', get_loaded_extensions())) return true;
        else return false;
    }
    
    if (_iscurlsupported()) echo “cURL is supported”; else echo "cURL is NOT supported";
    ?>

    Don’t use fancy quotes in PHP code. Use plain quotes and only ever use a plain text editor.

    Thread Starter Copywrite

    (@copywrite2012)

    OK thank-you for your reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Testing cURL code throws error’ is closed to new replies.