问题
I'm trying to develop a Facebook app on Heroku with PHP. I set up the default Heroku Facebook app and it works fine on the production server. I set up another app on Facebook to be the local test app and set the URL as http://profanitytracker.localhost. I set this URL up as an Apache VirtualHost and put in the development app's App ID and Secret. When I try to run my app locally, I get an HTTP 500 error.
Here is what I see in my browser...
The website encountered an error while retrieving http://profanitytracker.localhost/?state=4109e82dd75dc7a224c2b01bbb3d2c7b&code=AQC26Ff9DZBhbT2cd4Zc-0KTNDsIooYzmEKVM_YTWxKYX3RF4V389qHBGUuH4_3PnUIOyXBYFmq7GKPK_b2bskYNLkj7aWHnOQHQI1NxmklZRCIuaUZA0nYfsEhJDDhxUmaYG0DICIRgrM_S3bWuN69VGOZSWqWlsA0ioyGh1ufa5-8Nd9LhSm6iREV54miQmgU#_=_. It may be down for maintenance or configured incorrectly.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
Here are the errors that come up in the Apache server log...
[Sun Jan 15 17:35:53 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /var/www/profanitytracker/index.php on line 4
[Sun Jan 15 17:35:53 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /var/www/profanitytracker/AppInfo.php on line 36
[Sun Jan 15 17:35:53 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /var/www/profanitytracker/AppInfo.php on line 36
[Sun Jan 15 17:35:53 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: code in /var/www/profanitytracker/FBUtils.php on line 75
[Sun Jan 15 17:35:54 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /var/www/profanitytracker/index.php on line 4, referer: http://profanitytracker.localhost/
[Sun Jan 15 17:35:54 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /var/www/profanitytracker/AppInfo.php on line 36, referer: http://profanitytracker.localhost/
[Sun Jan 15 17:35:54 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /var/www/profanitytracker/AppInfo.php on line 36, referer: http://profanitytracker.localhost/
[Sun Jan 15 17:35:54 2012] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function curl_init() in /var/www/profanitytracker/FBUtils.php on line 99, referer: http://profanitytracker.localhost/
回答1:
It looks like you do not have cURL functions installed.
Run a php_info() file and check for any mention of cURL functions.
来源:https://stackoverflow.com/questions/8874425/500-error-developing-heroku-php-facebook-app-locally