Seems like the domxml.so module doesn't get loaded.
Check the error_log file for any error messages.
That file should be in /usr/local/apache2/logs
Thomas
Seems like the domxml.so module doesn't get loaded.
Check the error_log file for any error messages.
That file should be in /usr/local/apache2/logs
Thomas
[root@ns1 register]# tail -f /usr/local/apache2/logs/error_log
[Fri Dec 03 17:46:49 2004] [warn] child process 9797 still did not exit, sending a SIGTERM
[Fri Dec 03 17:46:49 2004] [warn] child process 10541 still did not exit, sending a SIGTERM
[Fri Dec 03 17:46:49 2004] [warn] child process 10542 still did not exit, sending a SIGTERM
[Fri Dec 03 17:46:49 2004] [warn] child process 10543 still did not exit, sending a SIGTERM
[Fri Dec 03 17:46:49 2004] [warn] child process 10553 still did not exit, sending a SIGTERM
[Fri Dec 03 17:46:50 2004] [warn] child process 9760 still did not exit, sending a SIGTERM
[Fri Dec 03 17:46:51 2004] [notice] caught SIGTERM, shutting down
[Fri Dec 03 17:55:52 2004] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429/domxml.so' - /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429/domxml.so: cannot open shared object file: Not a directory in Unknown on line 0
[Fri Dec 03 17:55:53 2004] [notice] Apache/2.0.49 (Unix) mod_perl/1.99_08 Perl/v5.6.1 mod_ssl/2.0.49 OpenSSL/0.9.6b PHP/4.3.6 configured -- resuming normal operations.
There is /no-debug-non-zts-20020429/
but when I gives the command
[root@ns1 register]# cd /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
-bash: cd: /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429: Not a directory
should i again recomplie PHP-4.3.6??
Ok,
I think I know what happened ... in one of your last posts you wrote that the directory .../extensions doesn't exist. Did you create just ..../extensions or ..../extensions/no-debug-non-zts-20020429 ?
I think that no-debug-non-zts-2002042 is a file (domxml.so renamed).
Do the following. Remove no-debug-non-zts-20020429 with
rm -f /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
That should work if that "directory" is a file.
Afterwards create that directory and then copy the domxml.so file from your home directory to that directory.
Then restart the web server. I don't think that you need to recompile PHP again.
Thomas
[root@ns1 no-debug-non-zts-20020429]# ls
[root@ns1 no-debug-non-zts-20020429]#
there is no 'domxml.so' file.
but when i gives the
[root@ns1 extensions]# cp /home/sandhya/php-4.3.6/modules/domxml.so /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
cp: overwrite `/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429'? y
means that file is there.but it seems invisible. why?
Hmmm ... still seems to be a file. Execute the following three commands:
rm -rf /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
mkdir /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
cp /home/sandhya/php-4.3.6/modules/domxml.so /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429/domxml.so
Thomas
[root@ns1 lib]# rm -rf /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
[root@ns1 lib]# mkdir /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
[root@ns1 lib]# cp /home/sandhya/php-4.3.6/modules/domxml.so /usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429/
[root@ns1 lib]# cd extensions/no-debug-non-zts-20020429/
[root@ns1 no-debug-non-zts-20020429]# ls
[root@ns1 no-debug-non-zts-20020429]#
domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20504
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.27
libxslt compiled against libxml Version 2.5.4
This section is getting displayed in php.ini()
Wrong directory:
[root@ns1 lib]# cd php/lib/extensions/no-debug-non-zts-20020429/
In php.ini the extension_dir is
/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
But the lines in your last post look like
/usr/local/apache2/php/lib/extensions/no-debug-non-zts-20020429
(see the missing php ater lib)
It seems like the extension_dir variable in php.ini is set to a originally not existing directory.
So I'd suggest to remove
/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
Then change extension_dir in php.ini to
/usr/local/apache2/php/lib/extensions/no-debug-non-zts-20020429
and copy the domxml.so file to that directory.
It doesn't make sense to create a second extension directory if one already exists.
Thomas
it is ok?
if that file is in this path
#/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20020429
[root@ns1 no-debug-non-zts-20020429]# ls
domxml.so
or should i again change that path to
/usr/local/apache2/php/lib/extensions/no-debug-non-zts-20020429/
which path is ok?
when i run that particular file which contains
$domdoc = domxml_open_file($sectionfile);
$dom = $domdoc->first_child();
Now it gives the error on line '$dom = $domdoc->first_child();'
Fatal error: Call to a member function on a non-object
Both are ok. Just make sure that the extension_dir variable in php.ini is set to the directory with the domxml.so file.
It doesn't matter which directory you use as long as extension_dir in php.ini matches.
Sorry ... didn't want to confuse you
Thomas
Now I uncomment that dl() like
<?
/ required for some broken setups (like mine) /
dl("mysql.so");
dl("domxml.so");
.
.
?>
when execute it gives the error like
Warning: domxml: Unable to register functions, unable to load in Unknown on line 0
Did you enable the domxml extension in php.ini ? I that case you shouldn't need to dl domxml.so.
Additionally, check the error_log for any errors.
Thomas
the log message
PHP Warning: Unknown(): Unable to load dynamic
library '/usr/local/apache2/php/
lib/php/extensions/no-debug-non-zts-20020429/domxml.so' - /usr/local/apache2/php
/lib/php/extensions/no-debug-non-zts-20020429/domxml.so: cannot open shared obje
ct file: Not a directory in Unknown on line 0
[Fri Dec 03 17:55:53 2004] [notice] Apache/2.0.49 (Unix) mod_perl/1.99_08 Perl/v
5.6.1 mod_ssl/2.0.49 OpenSSL/0.9.6b PHP/4.3.6 configured -- resuming normal oper
ations
[Fri Dec 03 18:39:10 2004] [notice] caught SIGTERM, shutting down
[Fri Dec 03 18:39:40 2004] [warn] Init: Session Cache is not configured [hint: S
SLSessionCache]
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/apache2/php/
lib/php/extensions/no-debug-non-zts-20020429/domxml.so' - /usr/local/apache2/php
/lib/php/extensions/no-debug-non-zts-20020429/domxml.so: cannot open shared obje
ct file: Not a directory in Unknown on line 0
[Fri Dec 03 18:39:41 2004] [notice] Apache/2.0.49 (Unix) mod_perl/1.99_08 Perl/v
5.6.1 mod_ssl/2.0.49 OpenSSL/0.9.6b PHP/4.3.6 configured -- resuming normal oper
ations
[Fri Dec 03 18:50:35 2004] [notice] caught SIGTERM, shutting down
[Fri Dec 03 18:50:42 2004] [warn] Init: Session Cache is not configured [hint: S
SLSessionCache]
[Fri Dec 03 18:50:43 2004] [notice] Apache/2.0.49 (Unix) mod_perl/1.99_08 Perl/v
5.6.1 mod_ssl/2.0.49 OpenSSL/0.9.6b PHP/4.3.6 configured -- resuming normal oper
ations
[Fri Dec 03 18:57:01 2004] [error] [client 192.168.0.130] Directory index forbid
den by rule: /home/safesquid/register/
means i have to comment the line??
extension=domxml.so in php.ini
No..
that line should not be commented.
Bcoz,when i comment it and run the phpinfo.php
domxml' section gets disappered.
so
extension=domxml.so
should be in php.ini
Then?
why these errors are ??
There are two ways:
a) add extension=domxml.so to php.ini and do not use dl('domxml.so');
b) do not add extension=domxml.so to php.ini and use dl('domxml.so');
If you add extension=domxml.so to php.ini and additionally use dl('domxml.so') then php tries to register the module functions twice which is the cause of the error messages because it is not possible to register the functions of one module twice.
If you don't add extension=domxml.so to php.ini then phpinfo() will not show any domxml extension. But as soon as a script uses dl('domxml.so') the extension will be available for that one script while it runs.
So far I never had to do with code that used dl(...) because on all servers (I had to do with so far) that use shared extensions that extensions are enabled in php.ini.
So I'm not sure if the following will show anything about domxml (just to test, because I'd recommend to enable the extension in php.ini as long as you're not concerned about PHP memory usage on a low memory system):
Comment the extension=domxml.so line and restart the web server. Then create the following script
<?PHP
dl('domxml.so');
phpinfo();
to check if phpinfo displays anything about domxml.
I think it should ....
Thomas
I commented dl extension in php.ini.
and the output of
<?PHP
dl('domxml.so');
phpinfo();
?>
domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20504
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.27
libxslt compiled against libxml Version 2.5.4
$domdoc = domxml_open_file($sectionfile);
$dom = $domdoc->first_child();
$depth = 0;
$dom = $domdoc->first_child(); for this line it gives the following error .
Fatal error: Call to a member function on a non-object ?
Looks good
I'd suggest the following to make sure that the scripts work with or without domxml (or any other extension loaded with dl in your scripts).
Example for domxml.so:
if (!function_exists('domxml_open_file')) {
dl('domxml.so');
}
The extension still needs to be available in some way. But with the code above you don't hav to care about if the (existing) extension has been in php.ini or not. Check the manual ... there are some examples (the code above lacks Windows support and dl doesn't work in all cases).
About the 'Call to a member function on a non-object' error:
I think domxml_open_file couldn't open the file or parse the file.
There are some examples here
Besides that if you want to loop through all child elements you first need to get e.g. the root node with
$docroot = $domdoc->document_element();
Check the domxml section of the manual
There are some examples (check the user contributed notes, too).
Thomas
[root@linux safesquid]# ./safesquid -c config.xml -s section.xml -f
Sat 04 15:48:18 [0] network: SSID: test0001
Sat 04 15:48:19 [0] error: ASSERTION: src/section.c:941 in function Section
Aborted
here is some line (sectioin.c) where above error is
.
.
.
.
ASSERT(element = sectionxml->FirstChildElement("section"));
ASSERT(element = element->FirstChildElement(name.c_str()));
TiXmlElement& section = *element;
ASSERT(element = section.FirstChildElement("comment"));
ASSERT(node = element->FirstChild());
this->comment = node->Value();
ASSERT(element = section.FirstChildElement("desc"));
ASSERT(node = element->FirstChild());
this->desc = node->Value();
.
.
.
and one auth.php (i didn't write this script) file is attached.
which is the main file that i had given in the URL of setting.h
which might be used to parse the section.xml file.
plz,if possible see it.
I have to make clear that above error is coming
bcoz of what?
what are the 100 posts have been made...
only bcoz of this....