2

I have a php script in which i'm making curls which works on one server, but not another.

When attempting to use it I get errors such as the following

Notice: Use of undefined constant CURLOPT_POST - assumed 'CURLOPT_POST'

Notice: Use of undefined constant CURLOPT_POSTFIELDS - assumed 'CURLOPT_POSTFIELDS'

In the script I have

$options = array( 
CURLOPT_POST           => true,
CURLOPT_POSTFIELDS     => $data,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER         => true,    
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_AUTOREFERER    => true,    
CURLOPT_CONNECTTIMEOUT => 120, 
CURLOPT_TIMEOUT        => 120,      
); 

$ch  = curl_init( $url ); 
curl_setopt_array( $ch, $options ); 
$content = curl_exec( $ch ); 

I don't know much about curling so I'm assuming its something to do with maybe the versions of php on the different servers?

If anyone could point me in the right direction it would be much appreciated!

user2085143
  • 4,162
  • 7
  • 39
  • 68

1 Answers1

1

Problem was php has its own separate curl module.

Ran

sudo apt-get install php5-curl

and problem solved!

Thanks to the guys who discussed it here

https://forum.owncloud.org/viewtopic.php?f=26&t=19911

user2085143
  • 4,162
  • 7
  • 39
  • 68