Blog Posts
Debug PHP code with PHP 5.6 and phpdbg
News Programming
September 13, 2014 | COMMENTS

PHP 5.6.0 has been released last month by the PHP Development Team. This new version includes some major changes and many improvements. See the release note.

phpdbg, Interactive PHP debugger

Main features added:

  • Constant scalar expressions.
  • Variadic functions and argument unpacking using the ... operator.
  • Exponentiation using the ** operator.
  • Function and constant importing with the use keyword.
  • phpdbg as an interactive integrated debugger SAPI.
  • php://input is now reusable, and $HTTP_RAW_POST_DATA is deprecated.
  • GMP objects now support operator overloading.
  • File uploads larger than 2 gigabytes in size are now accepted.

You can find the complete features list on the PHP Website.

One of the new features is the integrated phpdbg debugger which provides an interactive environment to debug your PHP code. phpdbg is implemented and distributed as an SAPI module. The phpdbg website has some good documentation, I recommend the Getting started with phpdbg section. This is not a replacement for XDebug.

Let's cover how to get started with PHP 5.6.0 and phpdbg on Mac OS X.

Continue Reading
disown a running shell process and reattach it to a new screen
Shell Tips
September 9, 2014 | COMMENTS

Stop worrying about your VPN connection dropping and your remote job to get kill. You can work on a remote server from your laptop or desktop in a safe and controlled way by detaching your screen session and reattaching later.

Continue Reading
sudo: sorry, you must have a tty to run sudo
Shell Tips
September 8, 2014 | COMMENTS

You just have configured your sudoers to execute some command without password from a ssh connection. Bummer, you just got an error:

sudo: sorry, you must have a tty to run sudo

No panic, there is an easy fix!

Continue Reading
redirecting a stdout to a file using sudo and tee
Shell Tips
September 8, 2014 | COMMENTS

When you attempt to modify a file without write permission on it, you will end-up with a permission denied error.

$ touch donottouch.txt && sudo chown root donottouch.txt
$ cat donottouch.txt
$ echo "change stuff" > donottouch.txt
-bash: donottouch.txt: Permission denied

Using sudo before echo won't help since the redirection will still apply within your shell environment. Here is few approaches to this problem.

Continue Reading
Markdown is dead. Long live Markdown!
News Programming
September 7, 2014 | COMMENTS

If you haven't been away of the internet for the past few years or if you are an occasional blogger, you must have heard about Markdown. It is a plain text format for writing structured documents. It has been developed in 2004 by John Gruber and widely adopted since then. The problem? A quite ambiguous syntax specification leading to many different implementations.

Continue Reading
  • ...