Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Jenny Swift
Jenny Swift
21,999 Points

Trouble installing phpdbg/using terminal

Hi, I tried to install phpdbg on my computer. I didn’t know what I was doing but I just copied and pasted the code from the installation instructions into my terminal. Here is the code from the installation instructions:

cd /usr/src/php-src/sapi
git clone https://github.com/krakjoe/phpdbg
cd ../
./buildconf --force
./config.nice
make -j8
make install-phpdbg

And this is what happened when I pasted it into my terminal:

Jennys-MacBook-Pro:~ 2013$ cd /usr/src/php-src/sapi
-bash: cd: /usr/src/php-src/sapi: No such file or directory
Jennys-MacBook-Pro:~ 2013$ git clone https://github.com/krakjoe/phpdbg
Cloning into 'phpdbg'...
remote: Counting objects: 5446, done.
remote: Total 5446 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5446/5446), 6.46 MiB | 64.00 KiB/s, done.
Resolving deltas: 100% (2969/2969), done.
Checking connectivity... done.
Jennys-MacBook-Pro:~ 2013$ cd ../
Jennys-MacBook-Pro:Users 2013$ ./buildconf --force
-bash: ./buildconf: No such file or directory
Jennys-MacBook-Pro:Users 2013$ ./config.nice
-bash: ./config.nice: No such file or directory
Jennys-MacBook-Pro:Users 2013$ make -j8
make: *** No targets specified and no makefile found. Stop.
Jennys-MacBook-Pro:Users 2013$ make install-phpdbg

Here I tried pressing enter and then it said:

make: *** No rule to make target `install-phpdbg'. Stop.

I don’t understand what’s going on but it seems evident it hasn’t installed how it was supposed to.

Would I have wrecked anything up on my computer by trying this and do I need to undo anything somehow?

And can anyone help me please to get phpdbg working?

2 Answers

Hey!

So I think there's a problem in your first line:

Jennys-MacBook-Pro:~ 2013$ cd /usr/src/php-src/sapi
-bash: cd: /usr/src/php-src/sapi: No such file or directory

This is the location you want to clone the repository. Because this doesn't exist right now, you're unable to navigate to this folder. I would guess following commands are therefore unable to execute properly because you're not in the correct location.

To fix, you'll need to start by making the directory you're trying to navigate to (cd = change directory). You can do this with mkdir (make directory).

mkdir /usr/src/php-src/sapi

followed by the tutorial code:

cd /usr/src/php-src/sapi

By the looks of things, you've already cloned the repository into whatever folder you were in before attempting to navigate to the correct folder. I think it would be a good idea to remove the git repository from this location. I guess you were in the home directory? Try:

 cd ~

then

ls -la

and look for a .git file. If one exists, there will be some files you might want to remove as well as the .git file itself. But be very careful - It's quite an important folder! Make sure you know exactly what you're removing before you attempt anything.

See where that gets you and let us know how you get on!

Jenny Swift
Jenny Swift
21,999 Points

Hi Tom, thanks so much for the reply. So I started with your first step and here's what happened:

Jennys-MacBook-Pro:~ 2013$ mkdir /usr/src/php-src/sapi
mkdir: /usr/src/php-src: No such file or directory

So I wondered if it wouldn't let me make the directory because usr/src doesn't exist. (I navigated to usr and did the ls command, and src wasn't there.) So I tried creating usr/src:

Jennys-MacBook-Pro:~ 2013$ mkdir /usr/src

and got this:

mkdir: /usr/src: Permission denied
Jenny Swift
Jenny Swift
21,999 Points

So here's where I'm up to:

I made the directory using the sudo command.

Then one by one I ran the commands from the installation instructions, again using sudo where necessary.

The following seemed to work without a problem:

Jennys-MacBook-Pro:phpdbg 2013$ cd /usr/src/php-src/sapi
Jennys-MacBook-Pro:sapi 2013$ git clone https://github.com/krakjoe/phpdbg
fatal: could not create work tree dir 'phpdbg'.: Permission denied
Jennys-MacBook-Pro:sapi 2013$ sudo !!
sudo git clone https://github.com/krakjoe/phpdbg
Password:
Cloning into 'phpdbg'...
remote: Counting objects: 5446, done.
remote: Total 5446 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5446/5446), 6.46 MiB | 338.00 KiB/s, done.
Resolving deltas: 100% (2969/2969), done.
Checking connectivity... done.
Jennys-MacBook-Pro:sapi 2013$ cd ../

But then I ran into a problem here:

Jennys-MacBook-Pro:php-src 2013$ ./buildconf --force
-bash: ./buildconf: No such file or directory

I suppose I could make a directory called buildconf.
But firstly, I'm not sure what './' means. I thought going up a directory was done with '../'. So I don't know where I would be making the buildconf directory, if that's what I'm supposed to do. And secondly, I find it strange that the installation instructions wouldn't include all the steps for the installation, requiring me to make certain directories that aren't there, so I'm unsure if I'm supposed to make the directory.

UPDATE: I've just realized that '.' represents the current directory. So am I simply supposed to make a directory called buildconf in the php-src directory, and then run the following command again from the php-src directory?

./buildconf --force

Permissions aren't too difficult to combat, you'll probably need to execute the command with a sudo prefix.

I don't know the exact exactly... But it lets you override most permission issues when you're not the root user. Try adding sudo to the front of the mkdir command and enter your password.