2

I want to fetch orders from my ebay seller account. I have integrated successfully on my local but when i hosted it to live then it gives error like :

Warning: curl_exec() has been disabled for security reasons in /home/GetOrders/get-common/eBaySession.php on line 74 Error sending request

when i see my phpinfo() it gives curl enabled. and I'm sure it's enabled because i'm using one another api with curl in my site as well.

help me please to get out from this. Thanks

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
  • *"Warning: curl_exec() has been disabled"*. Read the error message. https://www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/ – ʰᵈˑ Apr 10 '17 at 11:55

2 Answers2

1

The module might be activated, but it could be in the disabled list. According to this answer,

There is a php.ini directive called disable_functions. Functions added to this list will be disabled by PHP and when you try to execute those functions, you get this error. As mentioned, in all probability your hosting provider has added exec to the disabled list.

Community
  • 1
  • 1
Gabe Hiemstra
  • 269
  • 1
  • 14
  • disable_functions are empty. and in the same system i wrote code like curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic '. base64_encode('aaaaaa:aaaa'))); $status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); $result = curl_exec ($curl); This executes well but ebay call gives an error. – Yogesh Jalodara Apr 11 '17 at 11:13
  • Are you running in safe mode? – Gabe Hiemstra Apr 11 '17 at 11:17
  • it gives phpinfo() disabled also for security reason – Yogesh Jalodara Apr 11 '17 at 11:43
  • What is the exact location of your php.ini (the one you said where disable_functions was empty)? Does it match with the location the following command returns: "php --ini" ? Does it return additional php.ini locations? Note: PHP can use more than one or two additional php.ini files. – Gabe Hiemstra Apr 12 '17 at 08:12
0

look your php.ini file if curl_exec is listed inside disable_functions. if yes, remove it.

ex.

$ locate php.ini
/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini
/etc/php/7.0/fpm/php.ini
/usr/lib/php/7.0/php.ini-development
/usr/lib/php/7.0/php.ini-production
/usr/lib/php/7.0/php.ini-production.cli
$ cat /etc/php/7.0/apache2/php.ini  | grep disable_functions
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,\
pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,\
pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,\
pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,\ pcntl_exec,pcntl_getpriority,pcntl_setpriority,
marmeladze
  • 6,468
  • 3
  • 24
  • 45