Disable Xdebug running Composer on Trellis

When you use Trellis for local WordPress development, Xdebug is installed for debugging. This can be very useful. But when you run composer to update plugins, WordPress and so on and use Xdebug composer will become very slow. And you will get this warning

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug

Chris Loftus wrote about it . He explained how to Disable Xdebug running Composer.  He offered a solution to keep on using Xdebug but not while running cli stuff. A solution for setups with Ubuntu and PHP 7. And As we know that is what Trellis uses. So an awesome solution how to disable Xdebug running Composer on Trellis! The solution is to run the following command:

sudo phpdismod -s cli xdebug

This will disable Xdebug for CLI purposes. To quote Chris again:

The -s flag tells it to disable Xdebug for the CLI SAPI (/etc/php/7.0/cli) and not FPM.

And that is what we are looking for. I still want to be able to use Xdebug, but I do want composer to run smoothly and as fast as possible on my local Trellis LEMP server.

Once you have run that command you will no longer get the warning. Composer will be considerably faster from that moment on.

Command Line Installation WordPress

To install WordPress from the command line there are several tools available WordShell (commercial) and wp-cli (free)to name a few –  but here I will show you how you can use the basic command line or shell to speed up things.
We do a full WordPress installation from the command line we will use the command line  to download the latest WordPress version, untar  it(decompress the archive) and remove the WordPress folder using typical *Nix commands.

You can also add a new database using the shell. See here the command to import database data:


To create a new database you will need to log into the MySQL client and then create one.

mysql -u root -p


Could be you need to type mysql5 instead of mysql, but the rest should be the same. You then need to grant privileges to the database for a user of choice:

GRANT ALL PRIVILEGES ON dbasename.* TO user@host IDENTIFIED BY 'user_pass';