how do I install xdebug in php

Status
Not open for further replies.

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
Hello,

I've successfully got my php file to work in my jail and I want to install xdebug-2.4.1tgz in php but I'm having some problem. You see when I load my php page of what version I'm using and my is php 5.6.23. After downloading xdebug-2.4.1tgz then I unpack the download file with tar -xyzf xdebug-2.4.1.tgz and run cd xdebug-2.4.1 and then when I run phpize I got this problem:

Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

how do I install or check the autoconf.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Why don't you just install using the package manager?

Code:
pkg install php-xdebug
 

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
thanks for your help and I manage to get the xdebug php to work by typing the command of pkg install php-xdebug.
 

Attachments

  • xdebug.jpg
    xdebug.jpg
    118.3 KB · Views: 459

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
thumbs-up.gif
 

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
I have a question, even though I got the xdebug to install on php but there is no xdebug log file since its written no value. Even though I put these xdebug lines on php.ini
extension=/usr/local/lib/php/20131226/xdebug.so
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = /tmp/profiler


xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=1

but there is no xdebug log file created.
 

Attachments

  • xdebug log file.jpg
    xdebug log file.jpg
    20.4 KB · Views: 468

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Did you create the directory that you specified and are permissions set correctly for it?

From the docs:
make sure that the user who the PHP will be running as has write permissions to that directory
 

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
What directory are you taking about and how would I check the permissions on php whether it has the privileges to write directory
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
I type ls -1 and it shows and -1 means No read, no write, execute

.cshrc
.profile
COPYRIGHT
bin
boot
dev
etc
lib
libexec
media
mnt
package.xml
proc
rescue
root
sbin
show
sys
tmp
usr
var
xdebug-2.4.1
xdebug-2.4.1.tgz

but if I type ls 0,-2,-3,-4-5 it says
ls: illegal option --
is No read, no write, execute
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
What is the output of
Code:
ls -l /tmp/profiler
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
That's your problem. You specified for the output of the debug to a directory that doesn't exist. Either create it or choose a different directory.
 

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
I've decided to not use tmp/profiler since it does not exist and I did search for the package install php-xdebug the one I recently installed and the result shows.
php-xdebug-2.4.0_1 Xdebug extension for PHP

also when I check the folder for xdebug it looks like:

//davidjones/davidjonesdataset/jonesserver/usr/local/include/php/ext/xdebug/

or

//davidjones/davidjonesdataset/xdebug2.4.1/xdebug/

and I've tried:xdebug.profiler_output_dir="//davidjones/davidjonesdataset/jonesserver/usr/local/include/php/ext/xdebug/xdebug_profiler.h" and it does it not work when debugging.

I bascially want to get that xdebug into that sublime text 3 just like this one.

https://www.youtube.com/watch?v=rC2j1EKkL5E
 

Attachments

  • xdebug folder part 1.jpg
    xdebug folder part 1.jpg
    111.4 KB · Views: 421
  • xdebug folder part 2 in xdebug 2.4.1.jpg
    xdebug folder part 2 in xdebug 2.4.1.jpg
    141.3 KB · Views: 420

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
It appears you aren't grasping the folder structure or what that directory is for.

Create a directory within your jail.

Point your xdebug to it.

That's it. Don't use the directory that the installation created for the binary or the libraries, and don't give it full paths outside your jail (it doesn't know what that path is, all it knows is the path inside the jail)

What exactly is this to be used for? You seem to be going through a lot of trouble for this package, and are attempting to use it with sublime text (why?). I'm not familiar with the application or it's purpose, so please enlighten us instead of just saying "I want to open it in sublime text"
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Yeah just create the directory in the jail
Code:
mkdir -p /tmp/profiler
 

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11
I basically want to get the debugger program to work on the sublime text 3. I just created enter the command line of mkdir -p /tmp/profiler and then went back to php.ini file and change it back to xdebug.profiler_output_dir = /tmp/profiler save it and then in the command line I type the command restart apache24 service. Here's the picture of what the xdebug looks like for profiler

Then after that here's the picture of what it looks like under xdebug tmp profiler folder picture which is:

//davidjones/davidjonesdataset/jonesserver/tmp/profiler

and in that profiler folder there is no files.

also, here's the picture of what the file I'm been trying to execute my hello.php and I just want the file to go into the debug mode just like that video. https://www.youtube.com/watch?v=rC2j1EKkL5E
 

Attachments

  • xdebug tmp profiler.jpg
    xdebug tmp profiler.jpg
    39.5 KB · Views: 436
  • xdebug profiler output dir.jpg
    xdebug profiler output dir.jpg
    136.2 KB · Views: 418
  • xdebug start debugging sublime text 3.jpg
    xdebug start debugging sublime text 3.jpg
    93.9 KB · Views: 599
  • xbugsublimetext3.jpg
    xbugsublimetext3.jpg
    118.8 KB · Views: 453
  • xdebugsublimetext3 xdebug context.jpg
    xdebugsublimetext3 xdebug context.jpg
    67.5 KB · Views: 541

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
In your sublime text project, you have http://myipaddress, have you actually put in your jail IP?

Once connected to the jail IP, the path should be relative to the jail, so the path mapping should be /tmp/profiler
 

DavidGo43

Dabbler
Joined
Aug 2, 2016
Messages
11

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Your internal IP address is worthless to us. It's an unroutable address for us...
 
Status
Not open for further replies.
Top