composer update: mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory

proc_open(): fork failed errors#

If composer shows proc_open() fork failed on some commands:

PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar

This could be happening because the VPS runs out of memory and has no Swap space enabled.

free -m

total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0

To enable the swap you can use for example:

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

You can make a permanent swap file following this tutorial.

Please check also this article:

npm to add sb-admin-2 to laravel

First of all make sure you have node.js installed. If you haven’t so, install it:

Change directory to your laravel project and use npm to install sb-admin-2 like this:

npm install --global startbootstrap-sb-admin-2

If it compains for popper or other packages, use npm again to install them, like this:

npm install --global popper

Now, the tricky part for most people new to this:

Go to laravel path


Add this import:

@import "~startbootstrap-sb-admin-2/scss/sb-admin-2.scss";

Don’t forget to:

npm install 
npm run dev

Now change your app.blade.php with html markup from sb-admin-2, save and refresh your browser: you will end up with sb-admin-2 powerful laravel installation.

existing code to bitbucket

Let’s assume you ‘ve got setup a small project locally and it’s time to add it to bitbucket.

All you need to know is:

There are a couple of details though that could make your life difficult if you don’t pay the proper attention:

  • Locally:
git init
git add --all
git commit -m "Initial Commit"
  • Bitbucket: create a repo (but pay attention!) without adding any READMEs. Repo must be empty, otherwise upload will fail! Now, use clone button top-right corner && copy URL.
  • Locally (once again):
git remote add origin {{copied_url}} 
git push -u origin master


How to merge two zimbra mailboxes

If you want to merge 2 zimbra mailboxes, you can simply export the source mailbox and import it to the target mailbox. This can be easilly achieved with a couple of zimbra commands.

  • SSH into your zimbra server.
  • Change to zimbra server:
    su - zimbra
  • Now type:
    /opt/zimbra/bin/zmmailbox -z -m [email protected] getRestURL "//?fmt=tgz" > /tmp/temp.tgz && /opt/zimbra/bin/zmmailbox -z -m [email protected] postRestURL "//?fmt=tgz&resolve=modify" /tmp/temp.tgz
    This is actually two commands in one line: first export to temp.tgz and, if export is successfull (&&), import to target mailbox.

Make sure you replace [email protected] and [email protected] with proper addresses.

If the old mailbox is big you may encounter the following error:

ERROR: zclient.IO_ERROR (Read timed out) (cause: Read timed out)

This is because the programmers of zmmailbox command have set a default timeout to avoid endless execution. Luckily for us, they have also supplied zmmailbox with the t option which let us specify the amount of time before the timeout error occurs. An infinite timeout is set with -t 0. So you may now want to rewrite the command like this:

/opt/zimbra/bin/zmmailbox -z -t 0 -m [email protected] getRestURL "//?fmt=tgz" > /tmp/temp.tgz && /opt/zimbra/bin/zmmailbox -z -t 0 -m [email protected] postRestURL "//?fmt=tgz&resolve=modify" /tmp/temp.tgz

Initially we have found the the idea in zimbra forums ( and we have also tried it many times in our own servers, especially with merging some multi giga byte accounts we manage and host.

xampp + php + curl + ssl = fatal_error

If you use xampp with php and curl you might encounter an error like this:

Fatal error: Uncaught exception 'HttpClientException' with message 'cURL Error: SSL certificate problem: unable to get local issuer certificate' in HttpClient.php

If this is the case the solution is easy:

  1. Download cacert.pem from official curl page
  2. Copy cacert.pem to c:\xampp\cacert.pem (assuming your xampp installation resides on c:\xampp)
  3. Make sure mod_ssl in enabled on apache (assuming your apache configurations are lying on C:\xampp\apache\conf). Open httpd.conf and make sure line LoadModule ssl_module modules/ is not commented. Comments are prefixed with #. Disable comment simply by removing #.
  4. Now open php.ini (assuming php.ini is C:\xampp\php). Proportionally to the apache config, locate line extension=php_openssl.dll, remove comment (by deleting #). Make sure you have php_openssl.dll in C:\xampp\php\ext although there’s no reason not have it, I guess if this is the case, you should check the whole xampp installation.
  5. Stay a little bit on php.ini and add the following entries:

    Make sure the paths are correct according to what you have determined in step 1.

  6. This is not required, but if you like keep things tidy in php.ini, move curl.cainfo and openssl.cafile to the proper sections of the php.ini  [curl] and [openssl] respectively.
  7. Restart apache, otherwise your changes won’t have any effect. Reload your page and the error should have been removed.

I hope you’ve found this useful.



zimbra: multiple letsencrypt certificates and Unable to start TLS error

The following guide is tested against zimbra 8.8: Installing a Let’s Encrypt SSL Certificate

If this error occurs: ‘Unable to start TLS: hostname verification failed when connecting to ldap master.
make sure you have included your hostname in your letsencrypt signing domains and follow the guide once again.
For instance, if your hostname is, use letsencrypt to sign along with all other domains.


[email protected]:~/tmp/letsencrypt# ./letsencrypt-auto certonly --standalone -d -d -d -d -d

Make also sure you append to chain.pem

The whole procedure seems a bit tricky but actually it’s easy and it works.

Hopefully, some clever people have developed a bunch of scripts to automate the whole procedure, not all of them work in all cases. We have successfully tested the first automated method ( and it works great, as long as you keep incuding hostname in your config to avoid the “Unable to start TLS” error.

So open up your config at:


And edit the line with common names:

common_names=( "" "" "" "" "" )


Automated method installation instructions are very simple – just follow them here:

The manual method, although hasn’t any real difficulties, has some steps though that might prove a nightmare when it comes to renew certs every 3 months for letsencrypt certs. Anyhow, for all of you manual people, steps are the following:

  • Stop zimbra services: zmcontrol stop
  • Use letsencrypt to fetch the certificates: ./letsencrypt-auto certonly --standalone -d -d -d -d -d If asked, select expand (E).
  • Append missing certificate to chain.pem
  • Copy created certificates to zimbra location: cp /etc/letsencrypt/live/* /opt/zimbra/ssl/letsencrypt/
  • Set rights: chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/*
  • Login as zimbra: su - zimbra
  • Goto certificates path: cd /opt/zimbra/ssl/letsencrypt
  • Check certificate validity: /opt/zimbra/bin/zmcertmgr verifycrt comm privkey.pem cert.pem chain.pem
  • Take a backup: cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d")
  • Deploy certificates to zimbra installation: /opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem chain.pem
  • Restart zimbra: zmcontrol restart

migrate from zimbra to zimbra

Guide below is tested against zimbra 8.6, 8.7, 8.8. It’s not a full zimbra to zimbra migration, missed some things, but it works to migrating most important stuff. There might also exist some minor bugs, but if you have a basic experience in linux shell you won’t have a problem tweaking commands.

Zimbra Server Migration and Zimbra Account Transfer – The Perfect Method

There’s also this link provided by zimbra official wiki, but it’s not at all tested by our team: