Current release of Media:Youtube module (6x-1.2) causes fatal error when saving new nodes or editing existing nodes. Here is the error I've got.

Fatal error: Call to undefined function iconv_get_encoding() in /home/cctvcamb/public_html/sites/all/libraries/ZendGdata/library/Zend/Validate/Hostname.php on line 520

I have a content type configured with an embedded video field that can store values from Youtube or Vimeo. Vimo URLs work ok but Youtube urls always produce this error. New nodes are not stored, the crash seems to happen before any values from the node form are stored. Old nodes with existing fields still perform, but cannot be stored after editing. Perplexing problem.

I saw a similar issue in the queue that pointed to a different fatal error. Maybe they have something in common.

I can work out access to this site if anyone wants to see the error in action.

Comments

seaneffel’s picture

Title: Zend error, iconv_get_encoding... hostname.php on line 520 » Fatal error on storing nodes with YouTube values

Less lame title.

seaneffel’s picture

Priority: Normal » Critical

Thought about it some more. If the module is intended to embed YouTube videos and it crashes on that operation then the priority should be bumped up. We'll see later if it's only an issue for me.

aaron’s picture

Status: Active » Postponed (maintainer needs more info)

very peculiar. http://php.net/manual/en/function.iconv-get-encoding.php looks like it's been part of PHP since early on during PHP 4. What version do you have installed?

Note that if you're not uploading videos to YouTube, you probably don't need the Zend library, at least for Media: YouTube's purposes.

aaron’s picture

also, sean, could you paste your php info here? maybe it's part of some required php library.

pthornhi’s picture

Issue tags: +youtube media

+1 here.. I have the same problem and it is a very serious issue here. It's so mission critical that I can't really wait for the solution. Anyone know of a different way around this? Being this is the primary purpose of the module I am a little surprised it hasn't been addressed yet.

zonesny’s picture

Likewise, I'm also seeing the following error locally (on Xampp 1.7.3 for Windows with Drupal core 6.19) after upgrading to Embedded Media Field 6.x-2.4 and attempting to save YouTube embed urls:

Fatal error: Cannot redeclare class Zend_Loader in C:\xampp\php\PEAR\Zend\Loader.php on line 31

pthornhi’s picture

Ok.. I got mine fixed. Here is the deal -- iconv is a character conversion function provided by PHP. It evidently should come native with PHP5. So the documents say. However, it was not included with my installation. I have been using this module successfully for quite some time, so I am not sure what changed. Nevertheless, I recompiled php5 and re-installed it. All is well now. If you are using Macports, it seems as though the regular PHP5 install comes without this function. Instead one must use the php5-iconv port. So.... good luck to you all. Hope this works for you guys too.

pdevillo’s picture

same issue - I'm running drupal 7 on GoDaddy, so I cant recomplile PHP etc - any fixes?

pdevillo’s picture

seaneffel’s picture

Aaron, sorry for the delay. Here's the PHP info from our server:

http://www.cctvcambridge.org/info.php

aaron’s picture

Priority: Critical » Major
Status: Postponed (maintainer needs more info) » Closed (works as designed)
Issue tags: +Zend

sean, see the posts above. the issue is that your php has been compiled --without-iconv.

there are only two options, unfortunately, considering that i don't maintain the zend library (although a third would be to open an issue with them):

1) recompile php to add iconv.
2) remove the Zend library.

the second option should be reasonable if you're not actually sending videos to youtube through your server. unfortunately, if you actually do need the library, then the first option is all that's available.

seaneffel’s picture

Status: Closed (works as designed) » Needs review

I'll recompile and try it out. I think it would be good to put a note in the install steps that iconv is required for some operations this module will perform.

pedrosp’s picture

WSOD each time I save a node with a youtube link.
Driving me mad, it used to work fine.
Subscribing :(

seaneffel’s picture

Title: Fatal error on storing nodes with YouTube values » Document the requirement for PHP iconv in Media:YouTube module
Category: bug » task
Status: Needs review » Needs work

I was suddenly having error messages while saving nodes with YouTube URLs in the video embed field. It must have started after a recent module update. Adding proper iconv support to PHP solved the errors and I'm back in action. I had to get the web host to recompile PHP to finish it.

I'm lucky because I've got a great level of service from this web host. It makes me think that this should be documented for those people on shared hosting environments who won't have the ability to tweak their PHP build. Chances are there are loads of individuals using this module who suddenly can't (like #13 up there).

I'll change this issue to reflect a need for better docs, maybe even a project page note, to head off any level of frustrated users down the road.

pedrosp’s picture

IMHO, need to recompiling PHP5 on the server seems kind of weird.
If it use to work with former version of emfield, let's see what has changed.
10327 sites currently report using this module, my guess is that most of them do not have any problem, neither need to recompile PHP5 with iconv.

For the record I have try to remove Zend Library and test with last release, but same workaround.

Some problems has been reported with Ustream and Slideshare module as well.
I'm pretty confident this has to deal with some incompatibility.
I will clone my server and remove any module to track down some clues out there.
On early test I remember that a fresh install with minimal modules seems to works fine.

Michelle’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)
Issue tags: -youtube media

I am preparing a client's site to upgrade to PHP 5.6 and found that the old version of Zend they have is giving the error that iconv_set_encoding() is deprecated. So it sounds like this was removed from PHP. Updating to the latest Zend fixes it, presumably by removing the function, so I think this has become moot and the 6.x branch isn't supported anyway so closing the issue.