Title: Testing cURL code throws error
Last modified: August 19, 2016

---

# Testing cURL code throws error

 *  Resolved [Copywrite](https://wordpress.org/support/users/copywrite2012/)
 * (@copywrite2012)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/testing-curl-code-throws-error/)
 * 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)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/testing-curl-code-throws-error/#post-1668657)
 * 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](https://wordpress.org/support/users/copywrite2012/)
 * (@copywrite2012)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/testing-curl-code-throws-error/#post-1668662)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Copywrite](https://wordpress.org/support/users/copywrite2012/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/testing-curl-code-throws-error/#post-1668662)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
