PHP Extension using libtidy compiles, but does not load
Posted
by ewokker
on Stack Overflow
See other posts from Stack Overflow
or by ewokker
Published on 2010-06-05T19:18:18Z
Indexed on
2010/06/05
19:22 UTC
Read the original article
Hit count: 288
I wrote an extension in C++ that uses libtidy, and it runs perfectly under PHP when I compile PHP --with-tidy
.
However, it would be nice to have the extension run on a vanilla PHP. When I try to use the extension, I get something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'extension.so': undefined symbol: tidyCleanAndRepair in Unknown on line 0
and the extension is not loaded.
Obviously, the official tidy extension works fine. I have the relevant libtidy development packages installed on the system, and it compiles+links without a problem. I have tried to look through the code for the tidy extension, but it is a huge mass of macros - copying pieces at random felt like cargo code.
Besides linking to the library with PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
, Is there a PHP extension or C statement that fixes this error?
Thanks in advance!!
© Stack Overflow or respective owner