• Search:



Planet eZ publish




ez publish community gateway

› The Week in Review: eZ Platform releases, Tag Bundle updates, RAD in Symfony and more

With Christmas closing in, it looks like everyone in our community is ramping up for some ‘gifts’. In this week in review, I recap eZ Platform releases, an update on Tag Bundle from Netgen and lots more.

09/12/2016 8:30 pm (UTC)   http://share.ez.no   View entry   Digg!  digg it!   del.icio.us  del.icio.us

ez publish community gateway

› Extending eZ Find: How to specify minimum relevance values using Solr frange queries

eZ Find, the enterprise search extension for eZ Publish and wrapper for the Apache Solr search engine, is a highly performant alternative to manually searching through databases. We recently extended eZ Find to support Solr frange queries, and specifically to support minimum relevance values.

09/12/2016 2:37 am (UTC)   http://share.ez.no   View entry   Digg!  digg it!   del.icio.us  del.icio.us

mugo web

› Extending eZ Find: How to specify minimum relevance values using Solr frange queries

eZ Find, the enterprise search extension for eZ Publish and wrapper for the Apache Solr search engine, is a highly performant alternative to manually searching through databases. We recently extended eZ Find to support Solr frange queries, and specifically to support minimum relevance values.

08/12/2016 8:07 pm (UTC)   Mugo Web   View entry   Digg!  digg it!   del.icio.us  del.icio.us

netgen

› Integrating OAuth on eZ sites using NetgenEzSocialConnectBundle

In several recent projects we had been asked to implement ‘Login with Facebook’, ‘Login with Google’ functionality into eZ Publish 5 and eZ Platform, so we decided to go ahead and develop our own bundle based on HWIOAuthBundle.

08/12/2016 4:47 pm (UTC)   http://www.netgenlabs.com/Blog   View entry   Digg!  digg it!   del.icio.us  del.icio.us

ez publish community gateway

› The Week in Review: 1.7 LTS beta, new event dates and more

This week brings us dates for the eZ Conference and Web Summer Camp, a heads up on eZ Platform and eZ Studio 1.7 LTS beta and our regular social and events updates.

02/12/2016 7:37 pm (UTC)   http://share.ez.no   View entry   Digg!  digg it!   del.icio.us  del.icio.us

derick rethans

› Not Finding the Symbols

Not Finding the Symbols

Yesterday we released the new version of the MongoDB Driver for PHP, to coincide with the release of MongoDB 3.4. Not long after that, we received an issue through GitHub titled "Undefined Symbol php_json_serializable_ce in Unknown on Line 0".

TL;DR: Load the JSON extension before the MongoDB extension.

The newly released version of the driver has support for PHP's json_encode() through the JsonSerializable interface, to convert some of our internal BSON types (think MongoDB\BSON\Binary and MongoDB\BSON\UTCDateTime) directly to JSON. For this it uses functionality in PHP's JSON extension, and with that the php_json_serializable_ce symbol that this extension defines.

We run our test suite on many different distributions, but (nearly) always with our own compiled PHP binaries as we need to support so many versions of PHP (5.4-5.6, 7.0, and now 7.1), in various configurations (ZTS, or not; 32-bit or 64-bit). It came hence quite as a surprise that a self-compiled extension would not load for one of our users.

When compiling PHP from its source, by default the JSON extension becomes part of the binary. This means that the JSON extension, and the symbols it implements are always available. Linux distributions often split out each extension into their own package or shared object. Debian has php5-json (on which php5-cli depends), while Fedora has php-json. In order to make use of the JSON extension, you therefore need to install a separate package that provides the shared object (json.so) and a configuration file. Fedora installs the 20-json.ini file in /etc/php.d/. Debian installs the 20-json.ini file in /etc/php5/mods-available with a symlink to /etc/php5/cli/conf.d/20-json.ini. In both cases, they include the required extension=json.so line that instruct PHP to load the shared object and make its symbols (and PHP functions) available.

A normal PHP binary uses the dlopen system call to load a shared object, with the RTLD_LAZY flag. This flag means that symbols (such as php_json_serializable_ce) are only resolved lazily, when they are first used. This is important, because PHP extensions and the shared objects they live in, can depend on each other. The MongoDB extension depends on date, spl and json. After PHP has loaded all the shared extensions, it registers the classes and functions contained in them, in an order to satisfy this dependency graph. PHP makes sure that the classes and functions in the JSON extension are registered before the MongoDB extension, so that when the latter uses the php_json_serializable_ce symbol to declare that the MongoDB\\BSON\\UTCDateTime class implements the JsonSerializable interface the symbol is already available.

Distributions often want to harden their provided packages with additional security features. For that, they compile binaries with additional features and flags.

Debian patches PHP to replace the RTLD_LAZY flag with RTLD_NOW. Instead of resolving symbols when they are first used, this signals to the dlopen system call to resolve the symbols when the shared object is loaded. This means, that if the MongoDB extension is loaded before the JSON extension, the symbols are not available yet, and the linker throws the "Undefined Symbol php_json_serializable_ce in Unknown on Line 0" error from our bug report. This is not a problem that only related to PHP; TCL has similar issues for example.

With Fedora, the same issue is present, but shows through slightly different means. Instead of patching PHP to replace RTLD_LAZY with RTLD_NOW, it uses linker flags ("-Wl,-z,relro,-z,now") to force binaries to resolve symbols as soon as they are loaded process wide. This Built with BIND_NOW security feature goes hand in hand with Built with RELRO. The explanation on why these features are enabled on Fedora is well described on their wiki. Previously, this did expose an issue with an internal PHP API regarding creating a DateTime object.

But where does this leave us? The solution is fairly simple: You need to make sure that the JSON extension's shared object is loaded before the MongoDB extension's shared object. PECL's pecl install suggests to add the extension=mongodb.so line to the end of php.ini. Instead, on Debian, it would be much better to put the extension=mongodb.so line in a separate 99-mongodb.ini file under /etc/php5/mods-available, with a symlink to /etc/php5/cli/conf.d/99-mongodb.ini. Make sure you do the same for configuration directories for Apache. On Fedora, you should add the extension=mongodb.so line to the new file /etc/php.d/50-mongodb.ini.

Alternatively, you can install the distribution's package for the MongoDB extension. Fedora currently has the updated 1.2.0 release for Rawhide (Fedora 26). Debian however, does not yet provide a package for the latest release yet, although an older version (1.1.7) is available in Debian unstable. At the time of this writing, Ubuntu only provides older versions for Xenial and Yakkety.

30/11/2016 3:55 pm (UTC)   Derick Rethans   View entry   Digg!  digg it!   del.icio.us  del.icio.us

mugo web

› Building an accessible website: How to create accessible forms

Forms are an integral part of many websites and pose unique challenges related to making these interactive elements accessible to all users. 

29/11/2016 7:44 pm (UTC)   Mugo Web   View entry   Digg!  digg it!   del.icio.us  del.icio.us

mugo web

› Building an accessible website: Writing accessible alt tags for images

Creating alt tags that conform to Web Content Accessibility Guidelines (WCAG) ensures all of your readers can have access to your website's images. Here's a look at how to create effective alt tags for accessibility.

28/11/2016 7:20 pm (UTC)   Mugo Web   View entry   Digg!  digg it!   del.icio.us  del.icio.us

netgen

› Announcing Web Summer Camp 2017! Speakers Wanted

We at Netgen and Salsa Adria Productions are ready for another #websc adventure, are you? :) The website is out, we know the time and the place, and are looking for speakers and sponsors. We've also released all 2016 PHP and eZ Publish workshop videos, check them out!

24/11/2016 10:56 am (UTC)   http://www.netgenlabs.com/Blog   View entry   Digg!  digg it!   del.icio.us  del.icio.us

ez publish community gateway

› The Week in Review: Security Advisory, Platform.sh Developer Worfkflow, and More

This week brings us a look ahead to SymfonyCon Berlin, a follow up on developing on eZ Platform on Platform.sh, a gift from Kaliop, and lots more.

18/11/2016 6:56 pm (UTC)   http://share.ez.no   View entry   Digg!  digg it!   del.icio.us  del.icio.us