How To Enable PHP Curl Ngnix (Good for Social share counters)

| Drupal Development | 310 seen

Today I was eager to install and enable really cool Drupal module for my blog - Social Share Counter, this module looked simple - all I had to do, just download, enable and a little bit tweak around.

From module creator (s)

This module gives the share counts for only Facebook,Twitter and more which has some excellent features in more elegant manner. If you have a website, then you definitely need this module.

Unfortunately, after I successfully installed and enabled this module I noticed that share count is not increasing for my articles (I had one article - with more than 5,000 shares and likes today, it felt lame seeing fat zero, while my default Facebook plugin showed it correctly)

I noticed from recent log messages following notice:

Notice: Use of undefined constant CURLOPT_SSL_VERIFYPEER - assumed 'CURLOPT_SSL_VERIFYPEER' in _social_share_counter_parse() (line 254 of /srv/www/reinisfischer.com/public_html/sites/all/modules/social_share_counter/social_share_counter.module).

And I got it - most probably I didn't install php5-curl when did setup last time this server, see complete guide on how to setup LEMP Server Ubuntu 12.04 for serving Drupal on Nginx

Now, the fix is really easy - open your SSH terminal (putty, for example), login and:


sudo apt-get install php5-curl
sudo service nginx restart

if you are on Apache use following command to restart Apache2

​
sudo service apache2 restart

Nginx users will need to perform one more line of code, restart PHP-FPM

/etc/init.d/php5-fpm restart

That's it! Few simple lines of code and php curl is enabled. 

Speaking about me and those social counters, ahh... thus I was able to enable them and got some counters actually working after enabled php-curl, they never showed anything close to real count. I'm not sure foremost, but I guess service providers like Facebook and Twitter are shutting down (depreciated) their API's and ... I will stick with the default Facebook like and share button for now. See: Facebook share button for Drupal views

Used resources:

 

Latest articles

LEGOLAND Berlin Review: A Fun Family Activity in the German Capital

When planning a family trip to Berlin with children, most travelers immediately think about the Berlin Zoo — and rightly so. But if you are spending a few days in the German capital with younger kids, another solid half-day activity is the LEGOLAND Discovery Centre BerlinWe visited it in April 2026 together with our 7-year-old daughter during our…

Germany |

Ādģēri: The 30K Mistake That Turned Into a Long-Term Experiment

In 2023, we bought Ādģēri in an online auction.Price: just over €30,000.Financing: ~6% interest.Total expected payment over ~5 years: ~€40,000.Status (April 2026): more than half already paid.On paper, it was a bad deal.Realistically, we overpaid by at least 5–6× relative to what the property was objectively worth at the time. No serious buyer…

Ādģēri |