简体   繁体   中英

Fatal error: Call to undefined function iconv_get_encoding() PHP while working with Google App engine and ZendGdata

When i run a simple google app engine php code for reading google sheet data

i am getting a error Fatal error: Call to undefined function iconv_get_encoding() in/path/Zend/Validate/Hostname.php on line 1181

but when i checked in my phpinfo(), the iconv is enabled. If i need to install iconv? if yes can anyone provide the steps for doing so? I have OS yosemite and google app engine sdk

So where did i do wrong?

my php code

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"] . "/Zend/Gdata" . PATH_SEPARATOR . ".");
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets_SpreadsheetFeed');



$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient('$user', '$pass', $service);
$spreadsheetService = new Zend_Gdata_Spreadsheets($client);
$feed = $spreadsheetService->getSpreadsheetFeed();
?>

For future readers of this question, this issue would be dependent on the local PHP installation. If this error occurs you may need to add the following to your php.ini:

extension=iconv.so

The iconv extension is automatically enabled by default in production App Engine , so this should not happen for deployed apps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM