PHP

Setting up XDebug

The Vagrant environment has xdebug installed. In order to get it working, you need to do a few things on your IDE.

PHPStorm

Set up the server:

Docker - xDebug with PHPStorm

If you enable xdebug in your server every time we run a script in PHP is going to send the information to the listener, the Listener in our case is PHPStorm. First of all you must have your PHP image up and running, but sadly you cant use the official one, you will need to build your own image, you can use this small script that I have wrote

Returns the amount of memory allocated to PHP

The following function returns the amount of memory allocated to PHP

memory_get_usage

Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.

Returns the amount of memory allocated to PHP

The following function returns the amount of memory allocated to PHP

memory_get_usage

Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.

Enable .gitignore file

Running command: 

git rm -r --cached .

This removes everything from the index, then run:

git add .

Commit it:

git commit -m ".gitignore is now working"

Returns the amount of memory allocated to PHP

The following function returns the amount of memory allocated to PHP

memory_get_usage

Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.