Click to See Complete Forum and Search --> : Compile libphp4.so
Iīm trying to get php work together with expat and sablotron and have installed them several times with no luck. The versions I use are:
expat - 1.95-2
sablotron - 0.82
apache - 1.3.22 (preinstalled on Red Hat 7.2)
php - 4.1.2
I have, for various reasons, deleted the file libphp4.so because I thought that it would be compiled again when installing php. However, itīs not. My question is how do I convince the install script to compile libphp4.so? Is there a file or several files that I have to delete before compiling? I tried renaming the php.ini in /etc without any luck.
I install expat and sablotron with the usual ./configure, make, make install.
php is given these flags:
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-track-vars --enable-magic-quotes --enable-debugger --enable-xslt --with-xslt-sablot --with-dom --with-zlib-dir=/usr/src/php-4.1.2/ext/zlib
and then make, make install.
cgijoe
03-07-2002, 12:10 AM
Have you deleted you config.cache in your php directory? try that and run Config again... If you get it to work I have a different problem and you may run in to it as well (an error when trying to start th server (JS_Property error) so try deleting your config.cache file and run ./config again...
Nope, it wonīt make any difference. Not even if I delete the entire php folder.
I found the answer. There is a nifty option you can send to configure so that you donīt have to delete config.cache between each try (--cache-file=/dev/null). So here is how I did it:
./configure --with-apxs --with-mysql --cache-file=/dev/null --enable-track-vars --enable-magic-quotes --enable-debugger --enable-xslt --with-xslt-sablot --with-dom --with-zlib-dir=/usr/src/zlib-1.1.3 --with-xml
make
make clean (this is the command I was missing)
make install
Restart Apache and thatīs it.
Joe, about the JS_Property error. I donīt get that error (or anyone else) but when I try to access DOM functions (such as in this article: http://www.devshed.com/Server_Side/XML/XMLwithPHP/XMLwithPHP2/page1.html) I get nothing. I can parse an XML file, use Sablotron, stylesheets etc but all functions in DOM that deals with parents and children just wont work. Have they changed the function calls in php 4.1.2?
Hereīs an example
test.php:
<?
// data file
$file = "takt.xml";
// create a document object
$dom = xmldocfile($file);
// get XML version
echo "Version: " . $dom->version . "<br>\n";
// get XML encoding
echo "Encoding: " . $dom->encoding . "<br>\n";
// get whether standalone file
echo "Standalone: " . $dom->standalone . "<br>\n";
// get XML URL
echo "URL: " . $dom->url . "<br>\n";
// get XML character set
echo "Character set: " . $dom->charset . "<br>\n";
// get reference to root node
$root = $dom->root();
// get name of node - "me"
echo "root type: " . $root->type . "<br>\n";
echo "root name: " . $root->name . "<br>\n";
// get children of node, as array
$children = $root->children();
// get first child node
$firstChild = $children[0];
// let's see a few node properties
// get name of first child node - "name"
echo "firstChild name: " . $firstChild->name . "<br>\n";
// get content of first child node - "Joe Cool"
echo "firstChild content: " . $firstChild->content . "<br>\n";
// get type of first child node - "1", or "XML_ELEMENT_NODE"
echo "firstChild type: " . $firstChild->type . "<br>\n";
// go back up the tree!
// get parent of child - this should be <me>
$parentNode = $firstChild->parent();
// check it...yes, it is "me"!
echo "parentNode name: " . $parentNode->name . "<br>\n";
?>
takt.xml is too big to post here but it+s an ordinary XML file, nothing fancy.
This is what test.php produces:
Version: 1.0
Encoding: UTF-8
Standalone: -1
URL: takt.xml
Character set: 1
root type: 1
root name:
firstChild name:
firstChild content:
firstChild type: 1
parentNode name:
So name and content returns nada. Can anyone please shed some light on this.
Joe: Did you get the JS_PropertyStub problem fixed? If so can you tell me what you did? I can't figure out how to fix it.
Josh
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.