MacBook Camera(s) not working

If the build-in camera in your MacBook suddenly stopped working and/or it doesn’t recognize any external camera devices, hit the following bash command:
sudo killall VDCAssistant

Februar 1st, 2018

Composer: Not enough memory for installing Symphony Bundle

In case you’re getting the annoying memory message „PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 20480 bytes) …
Try this one: php -d memory_limit=-1 /usr/local/bin/composer require component

Januar 5th, 2018

Symfony Sonata Admin Bundle: Not saving foreign ID in a OneToMany relationship

If you’re setting up a one-to-many relationship between two entities, don’t forget to set the parent for your child entity as well. Otherwise you’ll end up saving the data without the foreign (parent) id in your database.

In your parent entity class:

public function setChildren($children)
  if (count($children) > 0) {
    foreach ($children as $child) {

  return $this;

public function addChild(Child $child)


The „$child->setParent($this);“ part is something that can be easily overseen …

For finally setting the children in the parent entity, you’ll have to add/modify your parent entity listener:

public function prePersist($parent)

public function preUpdate($parent)


Source: stackoverflow

Dezember 24th, 2017

Symfony: ManyToMany relation with self reference

Creating a many to many relation with self reference is straight forward (see docs). However I had to edit the „getFriendsWithMe“ method to get friends for ALL users (the original user where the friends are added and vice versa: The „new“ friends of the user should also display the original user as their friend):

public function getFriendsWithMe()
  return new ArrayCollection(
    array_merge(array_merge($this->friendsWithMe->toArray(), $this->myFriends->toArray()))

Without the editing, I only got the original user to show his new friends but the new friends never showed the original user as their friend.

November 17th, 2017

Using Twig 2 (within Symfony) with PHP 5.xx …

… causes the following error message: „Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given (…)“. Just update your PHP version and all should be good.
The Twig version you are currently using in your Symfony can be seen within your composer.lock file.

Oktober 23rd, 2017

PHP + Elasticsearch: No alive nodes found in your cluster

When working with Elasticsearch and php (i.e. see elasticsearch for php) it might happen that you’ll get an „No alive nodes found in your cluster“ error when connecting to the cluster from your hoster while everything works fine locally.

The (main) reason might be that you’re using the given port 9243 and the hoster doesn’t allow your scripts to connect to that host. Just change the port to the standard ssl port 443 and everything should work as intended.

August 10th, 2017

New (free) resource for stock photos

Shopify launched a new project called „Burst“ that you can add as a new stock photo resource. The service provides „Free photography for entrepreneurs“ as it is described on Burst’s homepage.

The photos come along with a Creative Commons Zero license, which means you’re allowed to basically do everything with the photos (see details on Burst’s FAQ). Tho you’re still allowed to credit the author 😉

Original source:

For everyone who didn’t find what he/she was looking for: put together a list with (almost) 100 free and freemium sources of stock photos:

If you want to know or learn how to include images properly in your blog you can check out this fine article on

April 4th, 2017

Mac Apache not starting because of PHP standard module

If you have a problem with Apache not starting although there’s no error log entry (and sudo apachectl configtest also doesn’t help), try
sudo apachectl -X
That way the debug mode is enabled and you get to see every problem that prevents Apache from starting. Even if it’s a PHP warning that is caused by the standard PHP module:
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/, 9): Library not loaded: /usr/local/php5/lib/libcurl.4.dylib

If you encounter that warning / error, comment the php5_module line out (to find in /etc/apache2/httpd.conf):
#LoadModule php5_module libexec/apache2/

Februar 24th, 2017

macOS Sierra: Upgrading PHP to 7.x

For those of you who want/need to upgrade PHP to version 7 and keeping it simple: There’s a neat tutorial on

Just run the following command on your terminal:
curl -s | bash -s 7.1

After you upgraded to PHP 7 you need to update your PATH and save it in your ~/.bash_profile:
export PATH=/usr/local/php5/bin:$PATH;

Check your PHP version on the terminal:
php -v

Februar 18th, 2017

The reactive programming paradigm

I think I’m getting old. There’s a new programming paradigm floating around (for four years) which I’ve barely heart of. And now that I know it exists (by „stumbling“ over it via learning Angular 2) I can’t imagine coding without it ever again. There’s even a manifest (see:

Reactive programming focuses on the change of a state over time not just on the state in that particular moment.
The inevitable advantage of that kind of programming is that we actually don’t need to take care of the new state but let the application handle everything necessary (like seen in Angular 2’s Two Way Data Binding).

As debugging is also affected by the paradigm it was very unfamiliar to work with streams and observables at the beginning. You can’t console.log your way from everywhere in the application. You have to follow the „flow“ (i.e. stream) to get the desired information. But once you got used to it, working reactive feels more natural than the old approach.

Februar 7th, 2017