20. October 2016

Symfony2 on DEV Caching Issue

I’ve been having a caching issue in Symfony for the last couple of days now. I know I messed up something in MAMP/PHP settings, I just don’t remember what. So after a couple of searches, I found a hacky way to solve this issue by adding this opcache_reset() function under /web/app_dev.php.

$kernel = new AppKernel('dev', true);
// $kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$kernel->terminate($request, $response);

21. May 2016

Drupal's Drush Segmentation fault:11

Today I’m gonna show you how to fix segmentation fault:11 error in your DRUSH.

This is a conflict .info file and node modules. Remember, when we did the NPM install, some of the modules have .info file extension in them. drupal is now confused having more than one .info file in your theme. And some of the pages in your site may not load.

Let’s now fix this error. Delete the node_modules folder and add this script in your package.json.

  "scripts": {
    "postinstall": "find node_modules/ -name '*.info' -type f -delete"

Now when you do npm install add –unsafe-perm at the end.

sudo npm install --unsafe-perm

And now do drush and you’ll be good.

drush cc all

09. May 2016

MongoDB Permission

MongoDB starting : pid=12450 port=27017 dbpath=/data/db 64-bit host=arvind-MacBook-Pro.local
db version v3.2.5
git version: 34e65e5383f7ea1726332cb175b73077ec4a1b02
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
options: {}
exception in initAndListen std::exception: boost::filesystem::status: Permission denied: "/data/db/storage.bson", terminating
dbexit: rc: 100

Have you experience this error before? If yes! here’s how to fix it. All you need to do is to give permission to /data/ folder in the root directory.

sudo chown -R arvind:staff /data

Now try running mongod again and everythings a ok.