[HOWTO] Tidy extension on Snow Leopard

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

[HOWTO] Tidy extension on Snow Leopard

Postby vincentc » 03. September 2009 11:00

Hello,

Here is a HOWTO add tidy support via XAMPP extension on Snow Leopard (SL). Hope you will find usefull :

1. Install Apple Xcode from the SL install DVD.
(I don't know if it is needed, but i have installed XAMPP Dev package too.)

2. Download and extract PHP 5.3.0.

3. Go to 'tidy' directory
Code: Select all
cd Downloads/php-5.3.0/ext/tidy/


4. Modify ext/tidy/tidy.c from the downloaded PHP (step 3) as documented in this link, http://sarth.thallos.org/2008/01/php-525-compile-error-macro-issue.html.

5. Compile tidy extension in 32bit, cause i think XAMPP is in 32 too :
Code: Select all
/Applications/XAMPP/xamppfiles/bin/phpize-5.3.0
CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config
CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 make
CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 sudo make install

(maybe CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 are not needed everyline, but i'm not a master in compilation)

php.ini should have "extension=tidy.so" added automatically and tidy.so putted directly to /Applications/XAMPP/xamppfiles/lib/php/php-5.3.0/extensions/no-debug-non-zts-20090626/

Finally, restart XAMPP and verify via phpinfo(); if the tidy extension loaded. Enjoy !
Last edited by vincentc on 03. September 2009 12:35, edited 1 time in total.
vincentc
 
Posts: 7
Joined: 30. October 2008 11:03

Re: [HOWTO] Tidy extension on Snow Leopard

Postby Wiedmann » 03. September 2009 12:09

Code: Select all
./configure

I guess it's better to use:
Code: Select all
./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

Thus "make install" can copy the extension to the right directory and can modify the correct "php.ini".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: [HOWTO] Tidy extension on Snow Leopard

Postby vincentc » 03. September 2009 12:37

Thanks, I modified my initial post accordingly to your tip.
vincentc
 
Posts: 7
Joined: 30. October 2008 11:03

Re: [HOWTO] Tidy extension on Snow Leopard

Postby Adrian B » 05. January 2010 19:31

Thanks for this HOWTO, I first had some issues, but after a clean install of the latest XAMPP and XAMPP Dev package and a clean download of PHP 5.3.0 it worked. I did have to manually add the line "extension=tidy.so" in php.ini.
Adrian B
 
Posts: 5
Joined: 20. August 2009 11:35

Re: [HOWTO] Tidy extension on Snow Leopard

Postby buggedcom » 23. April 2010 21:36

I would just like to add, this fails on 5.3.1 on SnowLeopard. The tidy.so is created and added to the extensions folder, however it wasn't added to the php.ini and also when the server is restarted php gives a startup error.
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/tidy.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/tidy.so, 9): no suitable image found. Did find:\n\t/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/tidy.so: mach-o, but wrong architecture in Unknown on line 0
buggedcom
 
Posts: 1
Joined: 23. April 2010 21:32

Re: [HOWTO] Tidy extension on Snow Leopard

Postby cmbg » 27. May 2010 21:46

@buggedcom -- it's looking for a universal binary. I ran into that too... setting my environment variables (below) before I attempted to compile fixed the problem.

Code: Select all
[~/php-5.3.1]$ MACOSX_DEPLOYMENT_TARGET=10.6
[~/php-5.3.1]$ CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
[~/php-5.3.1]$ CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
[~/php-5.3.1]$ CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
[~/php-5.3.1]$ LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
[~/php-5.3.1]$ export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET



--
Beverly Guillermo
cmbg
 
Posts: 1
Joined: 27. May 2010 21:36


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 9 guests