Mittwoch, 27. April 2016

Posted by Unknown | File under : ,

Sometimes, when you are running a PHP script from command line interface(CLI), a higher memory limit may be required in order for the script to be successfully executed.
This can be done by using the "-d" or "–define" option in the command. 

php -d memory_limit=2048m bin/phpunit

In my case, I want to run a project's tests that have high memory consumption.

Here is the link to the php manual's command line features and also directly for the command line options


Mittwoch, 13. April 2016

Posted by Unknown | File under : ,
I think this article is more a note for myself then a real serious blogpost.

For configuring php storm

here a a link with a good desciption: https://www.jetbrains.com/help/phpstorm/2016.1/configuring-xdebug.html?origin=old_help



Here is my current xdebug config taken from xdebug.ini


[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"

xdebug.profiler_output_dir=/tmp
xdebug.profiler_enable_trigger=1
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
xdebug.remote_host="localhost"
xdebug.idekey=XDEBUG
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"




Running from a browser with Extension

For the chrome browser you can install this extension:  xdebug-helper


Running from Postman


Postman is a nice tool for performing requests and see what comes back.

Add a simple query parameter to your url:

?XDEBUG_SESSION_START=PHPSTORM



Running from Console


Sometimes you want to debug scripts that were executed from console for that you can pass a parameter:

-dxdebug.remote_autostart=On


For example: a call for the symfony console could look like this:

php -dxdebug.remote_autostart=On bin/console


Keep in Mind


For all these options you have to keep in mind, that you should tell your IDE to be in debug mode and you should also set at least one meaningful debugging point