Facebook Graph Throwing Error on Server, Fine on localhost - facebook

I'm using the new facebook graph API and getting an odd error when I push to a web server.
My Code is pretty simple with fbmain.php calling facebook.php
<?php
include_once "fbmain.php";
$ab = $facebook->api('/cocacola/feed');
echo ($ab['data']['0']['message']);
When I run this locally, it works great without any errors.
When I run it on my server, I get the error:
Parse error: parse error, unexpected '{' in /home/content/w/e/s/wesbos/html/clients/audiobooks/wp-content/themes/ab/fb/fbmain.php on line 6
The part of fbmain.php its saying is causing the problem is :
try{
include_once "facebook.php";
}
Any idea why this wouldn't work on my server?

Turned out I was running PHP 4.x and try{} was only introduced in php5. Problem solved.

Related

Error (#8) An internal server error. Yii framework

I'm working on Yii2 project from external server. On that server everything work. But when I try to start it locally I get this error on first page.
Error (#8)
An internal server error occurred.
All other pages work except backend page. There I get the same error.
How can I fix it?
I changed value of YII_DEBUG to true
defined('YII_DEBUG') or define('YII_DEBUG', true);
in BaseYii.php file, got all errors and fixed them. Now everything works.
try this yii2 index.php
defined('YII_ENV') or define('YII_ENV', 'prod');
if (#$_GET['debug'] == 1) {
defined('YII_DEBUG') or define('YII_DEBUG', true);
} else {
defined('YII_DEBUG') or define('YII_DEBUG', false);
}
The last few times I've gotten this, it's been overflowing memory.
update the limit in php.ini

No results for query of Soundcloud API under iOS

When using the SC.get() function of the Soundcloud API instead of a result I receive a "HTTP Error: 0". The same codes is working under Android and in the browser (with same origin policy disabled).
This is the part of the code:
SC.initialize({client_id : "[myclientID]" ,redirect_uri:"[myURI]"});
SC.get('/resolve', {url : '[myURL]'}, function(track, error) {
if (error) alert('Error: ' + error.message);
trackImg[l] = track.artwork_url;
trackID[l] = track.id;
...
});
The URLs are white-listed as external hosts within the projects .plist and the Cordova.plist (the project is still running under phonegap 1.7.0). There is no warning in the Xcode console about blocked URLs..
Strangely enough the app was working fine a couple of weeks ago. The only thing I found changed was that the callback.html for the redirect URI got deleted but I created a new one.

InitializeServiceContext in Initializer.cs has started throwing "Unauthorized" in my test app

Using the c# devkit against qbo. When i left yesterday everything was working, however today attempting to initialze the servicecontext in my test application I started getting the "Intuit.Ipp.Exception.InvalidTokenException: Unauthorized" error.
ServiceContext context = Initializer.InitializeServiceContext(oauthValidator, realmId, string.Empty, string.Empty, dataSourcetype);
and the error is here in the InitializeServiceContext:
context = new ServiceContext(oauthValidator, realmId, intuitServiceType);
I registered my test company yesterday (i.e. I now have a paid quickbooks online account) am i not allowed to continue testing against a real account? Or have i made a bigger error somewhere.
Thanks
Edit:
When trying to log into my test app on the Intuit Developer Playground I'm getting the following error:
Oops! An error has occurred.
Please close this window and try again.
Error Code: internal_error
Message: Error Authorizing Request Token: <redacted-token>
Your OAuth tokens are no longer valid. Initializing the ServiceContext object for QBO retrieves the base URL for the realm, which requires authorization and is throwing the unauthorized error as a result.

http://facebook.com to get property LocaFacebook JS Error - Permission denied to get property Location.href from http://www.mysite.com

Simply loading the standard Facebook connect JS framework and getting the following error:
Permission denied for facebook.com to get property Location.href /www.mysite.com
The error happens on line 127 in the file :
static.ak.connect.facebook.com/connect.php/en_US/js/Api/CanvasUtil/Connect/XFBML
Using FF 3.5.7 and Firebug 1.5.0
Is anyone else getting this error?
It's an issue falsely reported by Firebug. Nothing to worry about.

Zend Framework ErrorController not working on live site?

My site is set up pretty much as per the Zend Quickstart guide. The default ErrorController works locally using MAMP. But now I've deployed it to my live site I get a blank page and a "500 Internal Server Error" according to FireBug when I go to an action that doesnt exist.
On my local server I get a 404 and a nicely formatted error page.
Any ideas anyone? I dont really know where to begin looking.
I'm confused :/
Thanks.
Gentlemen, we have a winner!
So for some reason my live server gives me this error:
[Sun Oct 18 10:56:53 2009] [error] [client 118.209.152.109] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Headtitle' was not found in the registry; used paths:\nZend_View_Helper_: Zend/View/Helper/:/var/www/vhosts/lindengardens.com.au/httpdocs/application/views/helpers/' in /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/Loader/PluginLoader.php:406\nStack trace:\n#0 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Headtitle')\n#1 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'headtitle')\n#2 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('headtitle')\n#3 [internal function]: Zend_View_Abstract->__call('headtitle', Array)\n#4 /var/www/vhosts/lindengardens.com.au/httpdocs/application/layouts/scripts/layout.phtml(32): Zend_View->headtitle()\n#5 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View.php(108): incl in /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/Loader/PluginLoader.php on line 406
I get the above error if I dont have something like
$this->view->headTitle("Linden Gardens Rainforest Retreat B&B Mt Dandenong - Error Page");
set in the controller.
Just setting the headTitle fixed the problem - I wonder why that works fine on my local server :/
thanks.