abemedia / shareCount

A PHP script to fetch the count of social shares, cache the results and output as JSON, JSONP or XML data.
GNU General Public License v2.0
100 stars 35 forks source link

Getting Parse and Syntax Error After Uploading The Donreach Plugin #17

Closed mustafastc closed 8 years ago

mustafastc commented 8 years ago

Hi,

First of thank you so much for open sourcing such precious scripts and letting everyone to use it for free. This surely requires a big heart. =)

I tried uploading the plugin scripts and files on a sub-domain located at http://count.mybloggertricks.com/

I also created a separate Mysql database and changed the config.php values to

/* database settings - only required to track shares */ public $db_type = 'mysql'; public $db_host = 'localhost'; public $db_name = 'mustafa_shares'; public $db_user = 'mustafa_shares'; public $db_pass = 'mypass';

But I am getting the following error on visiting the URL.

Parse error: syntax error, unexpected ':' in /home1/mustafa/public_html/count/share_count.php on line 37

There looks to be some syntax errors in the share_count.php file.

Am I doing something wrong. Would appreciate the slightest of help here.

abemedia commented 8 years ago

Hi Mustafa, The MySQL info was actually added when I was going to integrate logging of shares over time but the script was completely rewritten in Golang so the new features never got integrated into this version and the MySQL settings can be ignored. As for the error, what version of PHP are you using?

mustafastc commented 8 years ago

The PHP System Default Version on my server is 5.4

@abeMedia If the files are correctly installed on my server - (Uploading config.php , shares_count.php, cleanup.php and index.php). Will I be able to produce the same results using:

http://count.mybloggertricks.com/?url=http://google.com just like it does with:

https://count.donreach.com/?url=http://google.com

Would really need help in installation steps. What values shall i change in config.php?

abemedia commented 8 years ago

It appears you have an issue with permissions. Please make sure the files are set to 755.

mustafastc commented 8 years ago

@abeMedia I changed the permission of all files from 644 to 755 but same problem.

Which version of PHP is supported by Donreach?

I just checked my PHP version it is in fact: PHP Version 5.2.17 I changed the php version to 5.4 and the errors stopped. =)

When I visit: http://count.mybloggertricks.com I get this message

Error: No URL specified.

when I visit: http://count.mybloggertricks.com/?url=http://msn.com

It throws a 403 forbidden error that says:

Forbidden You don't have permission to access / on this server.

Getting same error even when I change file permissions to 777. Could you please help.

mustafastc commented 8 years ago

I was able to run your script on a local host though but I am getting results only for stumbleupon and for not for rest:

processShares({"url":"http:\/\/9gag.com","shares":{"total":203014,"facebook":"","twitter":"","google":"","linkedin":"","pinterest":"","stumbleupon":203014,"delicious":0,"reddit":"","buffer":"","vk":""}})

I would really appreciate if you update your script. Looks like it is not updated since a year.

abemedia commented 8 years ago

Hi, I just cloned the script as it is (changing no configuration values) and it worked on my box running PHP 5.5.9-1ubuntu4.13 without any problems. I can only assume it's an issue with your server.

mustafastc commented 8 years ago

Hi abemedia, Thank you for the response. The problem was surely with my webserver. I have made some modifications to the script and we will share it soon with our blog readers by attributing the credits to Donreach. Thank you for this awesome script

mustafastc commented 8 years ago

FINALLY WORKED AT : http://shares.ahmedzai.com/?url=http://9gag.com

The reason was that MOD security was blocking it. After white listing it, the script worked! :)

I have written a detailed tutorial on how to self upload the scripts in this blog post: http://www.mybloggertricks.com/2016/02/jumbo-share-counters-plugin.html

abemedia commented 8 years ago

Excellent, I'm glad you got it working!