Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : Xdebug setup on Mac OS 10.7.4 (Lion)



Threaded Mode | Print  

 Xdebug setup on Mac OS 10.7.4 (Lion), Xdebug appears to be installed properly, but AMPP doesn't see it (11 Replies, Read 4661 times)
tomb
Group: Member
Post Group: Newbie
Posts: 1
Status:
I'm a newbie, and I'm struggling with configuring xdebug for AMPPS on my Mac (10.7.4 Lion).

I followed steps provided by xdebug. org/ wizard.php to install xdebug on AMPPS:
"
Download xdebug-2.2.1.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.2.1.tgz
Run: cd xdebug-2.2.1
Run: phpize

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20090626
Zend Extension Api No:  220090626
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

Run: ./configure
Run: make
Run: cp modules/xdebug.so /Applications/AMPPS/php-5.3/lib/extensions/no-debug-non-zts-20090626
Create /Applications/AMPPS/php-5.3/etc/php.ini and add the line
zend_extension = /Applications/AMPPS/php-5.3/lib/extensions/no-debug-non-zts-20090626/xdebug.so
Restart the webserver
"

Everything seemed to run smoothly until it came time to work php.ini - I was a bit surprised that AMPPS was working properly but there was no php.ini file in:
php-5.3/etc

However I did find  /AMPPS/conf/php-5.3.ini - I tried adding the zend_extension path to that file, but had no success. I also copy/pasted the file into /AMPPS/php-5.3/etc but also had no success.

I also revised this code as the cp command didn't look right:
cp modules/xdebug.so /Applications/AMPPS/php-5.3/lib/extensions/no-debug-non-zts-20090626/xdebug.so

I'm stumped. Can anyone offer suggestions to solve this issue?

Best Regards

IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
tidus
Group: AMPPS Team
Post Group: Super Member
Posts: 1097
Status:
Hi,

Sorry for the trouble.

If you want to edit php.ini, please do it from AMPPS Application -> PHP Tab -> Configuration. And save it. Then restart Apache. AMPPS will handle the rest.

Note: Please do not edit etc/php.ini manually as AMPPS will replace it and all your configurations will be lost.

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Xdebug setup on Mac OS 10.7.4 (actually, 10.8.2)
techtourist
Group: Member
Post Group: Newbie
Posts: 5
Status:
I followed the steps as described above (and as instructed through the Xdebug wizard.  I updated the php.ini file through the AMPPS control module as prescribed here.

When I restart Apache, I can see xdebug listed in the Extensions area and it is checked.  However, when I run a test phpinfo(), xdebug is not listed.

Any ideas on how to confirm the install and make sure it is configured properly.  I'd like to integrate this with PHPStorm and enable debugging.  This seems to be the one area of conflict I can't resolve.

Quote From : tidus July 22, 2012, 6:01 am
Hi,

Sorry for the trouble.

If you want to edit php.ini, please do it from AMPPS Application -> PHP Tab -> Configuration. And save it. Then restart Apache. AMPPS will handle the rest.

Note: Please do not edit etc/php.ini manually as AMPPS will replace it and all your configurations will be lost.
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
tidus
Group: AMPPS Team
Post Group: Super Member
Posts: 1097
Status:
Quote From : techtourist March 21, 2013, 9:43 pm
Any ideas on how to confirm the install and make sure it is configured properly.  I'd like to integrate this with PHPStorm and enable debugging.  This seems to be the one area of conflict I can't resolve.

Hi,

If it is loaded you should be able to see in the following command of Terminal:
Code
/Applications/AMPPS/php/bin/php -m
It should throw a warning if its not loaded. Paste the output here.

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
techtourist
Group: Member
Post Group: Newbie
Posts: 5
Status:
Here's the result of the command:

Failed loading /Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so:  dlopen(/Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so, 9): no suitable image found.  Did find:
    /Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so: mach-o, but wrong architecture
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so' - dlopen(/Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so, 9): no suitable image found.  Did find:
    /Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so: mach-o, but wrong architecture in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so' - dlopen(/Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so, 9): no suitable image found.  Did find:
    /Applications/AMPPS/php-5.3/lib/extensions/ext/xdebug.so: mach-o, but wrong architecture in Unknown on line 0
No log handling enabled - turning on stderr logging
Cannot find module (LM-SENSORS-MIB): At line 0 in (none)
[PHP Modules]bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
ionCube Loader
json
ldap
libxml
mbstring
mcrypt
mhash
mongo
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
SQLite
sqlite3
standard
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]
the ionCube PHP Loader

It appears the xdebug was made with the wrong phphize?  Although, I followed the directions of the xdebug wizard using the default PHP engine that was shown.
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
tidus
Group: AMPPS Team
Post Group: Super Member
Posts: 1097
Status:
Hi,

What is the output of the following ?
Code
uname -m
Looks like you have 64 bit architecture and PHP is compiled on 32 bit.

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
techtourist
Group: Member
Post Group: Newbie
Posts: 5
Status:
Any tips on how to resolve this?
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
tidus
Group: AMPPS Team
Post Group: Super Member
Posts: 1097
Status:
Quote From : techtourist March 24, 2013, 9:43 pm
Any tips on how to resolve this?
Try this command after phpize :

Code
CFLAGS=-m32 ./configure


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
techtourist
Group: Member
Post Group: Newbie
Posts: 5
Status:
Quote From : tidus March 25, 2013, 5:45 am
Quote From : techtourist March 24, 2013, 9:43 pm
Any tips on how to resolve this?
Try this command after phpize :

Code
CFLAGS=-m32 ./configure
I entered the command after initializing phphize from within the AMPPS directory with the following result:

Code
unknown0026bb06a87f:xdebug-2.2.2 jeremiahholder$ CFLAGS=-m32 ./configurechecking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin12.3.0
checking host system type... i386-apple-darwin12.3.0
checking target system type... i386-apple-darwin12.3.0
checking for PHP prefix... /Applications/AMPPS/php-5.3
checking for PHP includes... -I/Applications/AMPPS/php-5.3/include/php -I/Applications/AMPPS/php-5.3/include/php/main -I/Applications/AMPPS/php-5.3/include/php/TSRM -I/Applications/AMPPS/php-5.3/include/php/Zend -I/Applications/AMPPS/php-5.3/include/php/ext -I/Applications/AMPPS/php-5.3/include/php/ext/date/lib
checking for PHP extension directory... /Applications/AMPPS/php-5.3/lib/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /Applications/AMPPS/php-5.3/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable eXtended debugging support... yes, shared
checking Check for supported PHP versions... supported (5.3.21)
checking for gettimeofday... yes
checking for cos in -lm... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
unknown0026bb06a87f:xdebug-2.2.2 jeremiahholder$ cp modules/xdebug.so /Applications/AMPPS/php-5.3/lib/extensions/ext

I still show the xdebug.so in the AMPPS PHP panel, but not in the phpinfo().

The command still shows the "wrong architecture".

Any walkthrough on how to get xdebug on the right architecture would be appreciated.  I had thought running phpize from within the xdegug directory using the AMPPS/php-5.3 would do it.

Thanks.
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
tidus
Group: AMPPS Team
Post Group: Super Member
Posts: 1097
Status:
Hi,

We haven't tried compiling xdebug module yet. So we don't have any walkthrough.

Generally it is like this for all extensions :
1. Extract source of any extension
2. cd path/to/src
3. /Applications/AMPPS/php/bin/phpize
4. LDFLAGS=-L/Applications/AMPPS/extra/lib CPPFLAGS=-I/Applications/AMPPS/extra/include CFLAGS=-m32 ./configure --enable-FEATURES
5. sudo make
6. sudo make install

./configure --help has exact information for optional features and packages.


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
techtourist
Group: Member
Post Group: Newbie
Posts: 5
Status:
Thanks for the tip.  I tried the following (both methods) after finding a walkthrough for 32bit configuration (of XAMP, but same idea):

Configure xdebug

Because XAMPP is build for i386 (32-bit) architecture, we have to modify default build flags, which otherwise would build for x86_64 (64-bit):

./configure --enable-xdebug \
--with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config \
CFLAGS="-arch i386 $CFLAGS" CCFLAGS="-arch i386 $CCFLAGS" \
CXXFLAGS="-arch i386 $CXXFLAGS" LDFLAGS="-arch i386 $LDFLAGS" \
edit: configure command updated to append variables instead of prepending them (thanks Sequan).

edit2: Alternatively, as suggested by Junaid below, on a Lion you could use the following command (haven’t tried it myself), which is essentially the same, only providing architecture as direct argument to compiler instead of setting it in FLAGS:

./configure --enable-xdebug CC="gcc -arch i386" CXX="g++ -arch i386"


I still get the wrong architecture when compiling.

I'm running xdebug 2.2.2 and phpize within the AMPPS/php-5.3 structure...

Quote From : tidus March 28, 2013, 5:37 am
Hi,

We haven't tried compiling xdebug module yet. So we don't have any walkthrough.

Generally it is like this for all extensions :
1. Extract source of any extension
2. cd path/to/src
3. /Applications/AMPPS/php/bin/phpize
4. LDFLAGS=-L/Applications/AMPPS/extra/lib CPPFLAGS=-I/Applications/AMPPS/extra/include CFLAGS=-m32 ./configure --enable-FEATURES
5. sudo make
6. sudo make install

./configure --help has exact information for optional features and packages.
IP: --   

Xdebug setup on Mac OS 10.7.4 (Lion)
tidus
Group: AMPPS Team
Post Group: Super Member
Posts: 1097
Status:
Hi,

I was able to compile successfully i also tested it. You can try the binary attached. Copy it into ext folder and chown it to your user if necessary.

Output of php -m :
.
.
.
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]
the ionCube PHP Loader



-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is September 2, 2014, 12:06 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.636