Combining Symfony Console and Linux Alias


One more day exploring Symfony.
This time diving around console commands I got tired to write always “php app/console …”.

So, why just not create an alias? As i’m using a vagrant box with ubuntu, just:

vagrant@vagrant-ubuntu-trusty-64/:$ sudo nano ~/.bashrc

At the end of the file, just add your alias like “alias <name> = ‘command’ ”

alias symf-console=’php app/console ‘

after that, save and exit
Now reload that file using:

vagrant@vagrant-ubuntu-trusty-64:/$ source ~/.bashrc

And thats it!

Notice that you have to change to your symfony directory for command success.
Try than:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/vhosts/symf_project$ symf-console list

Hope it helps!

Good Terminal for windows


CMDER terminal emulator for windowsLAMP with Vagrant with a windows system can be frustrating. I’m talking about terminal usage.
The built-in CMD of windows disable you a bit and is not too atractive to use.
I’ve found a terminal emulator called CMDER. It’s a nice and quite useful terminal full of small features that we really need to develop:

– Console Tabs: you can choose powershell, cmd and another types
– search feature: search box to find content around.
– edit features: custom copy and paste features.

Is really a must have!


As a portable exe, it can happen a execution error about missing DLL like:

The program can’t start because api-ms-win-crt-runtime-l1-1-0.dll is missing

Just install the C++ Redistributable:
x64: C++ Redistiributable
x32: x32 C++ Redistributable  CMDER Windows terminal emulator



Vagrant & Laravel: storage/sessions permission denied


Hi there!
Exploring Vagrant (awesome tool!) and recently used to me Laravel Framework I got a problem with new host created at my vagrant VMachine:

Permission denied to app/storage/sessions

At your vagrant file just add:

config.vm.synced_folder ".", "/vagrant", :mount_options => ["dmode=777","fmode=666"]

Just halt and up again your vagrant machine and it’s done!

Undefined index: role_id at BjyAuthorize


Strange error around here:

 PHP Notice:  Undefined index: role_id in /var/www/site/vendor/bjyoungblood/bjy-authorize/src/BjyAuthorize/Provider/Role/ZendDb.php on line 90


It seems that SQL script creates user_role table with userId field but, at php module is requested role_id… just change column name and it’s fine!

Hope it helps!

Zend Framework 2: Use Different Layout Templates for each module


Hi there! Having different modules (like: default application module and CustomModule1) I had trouble setting different html layouts to them!

The solution is edit your module’s bootstrap like this:

public function onBootstrap(MvcEvent $e)
// You may not need to do this if you’re doing it elsewhere in your
// application
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();

$sharedEventManager = $eventManager->getSharedManager(); // The shared event manager
$sharedEventManager->attach(__NAMESPACE__, MvcEvent::EVENT_DISPATCH, function ($e) {
$controller = $e->getTarget(); // The controller which is dispatched
$controllerName = $controller->getEvent()
if (!in_array($controllerName,
) {

please do not forget to include the template at templates path at module.config.php

‘view_manager’ => array(
‘template_map’=> array(
‘layout/layoutadm’ => __DIR__ . ‘/../view/layout/layoutadm.phtml’,

Hope it helps!