1

How can achieve what you can see below? I read this question but did not succeed. My OS is Lubuntu 13.10 which is based in Ubuntu 13.10

You are technically ready to go, but
there's one extra step that I like to do to make command line debugging nice
and quick. I create a bash script called "php-xdebug", which automatically
starts the debugger engine. The script looks like this (unix only): >

#!/bin/bash
export XDEBUG_CONFIG="idekey=xdebug"
/usr/bin/php "$@"
<
Run "chmod +x" on the file and put it somewhere in your $PATH list, and you can
then use this instead of php when debugging. For instance, instead of "php
myscript.php", run "php-xdebug myscript.php" to start the debugger session.
pablofiumara
  • 1,099

2 Answers2

3

The PATH is a list of folders which are automatically checked for executables when you run a program name. Here is what we do.

After the comment below there seems to be more of a problem so lets start from scratch.

Open gedit

Paste in

#!/bin/bash
export XDEBUG_CONFIG="idekey=xdebug"
/usr/bin/php "$@"

Save as

php-xdebug.sh

Go to the folder (in the terminal) with the file and run

chmod +x php-xdebug.sh

Then check what your PATH is with:

echo $PATH

You could move the file into one of the folders listed when you ran this command.

Normally a better solution is to edit the PATH (tutorial here) to search inside the folder where the script already is.

Now try:

php-xdebug.sh
1

On Ubuntu (including Lubuntu), one natural place to put such a script is in ~/bin. If that folder does not exist already, do

mkdir ~/bin

Next time you log in, it will be automatically included in PATH, i.e. no need to alter the PATH variable.