source build XML problem

trevarthan

14-11-2004 22:38:26

Hello,

I'm trying to get a source tar.gz of NetMRG built and running on my Gentoo Linux machine so I can use it at work and make an ebuild for the Gentoo community.

netmrg-0.18.2 builds without blatant errors. Unfortunately, my /usr/local/etc/netmrg.xml file doesn't seem to be getting read properly. When I go to http//localhost/netmrg, I get the following error

Warning main(/webfiles/images/default/imagespec.php) failed to open stream No such file or directory in /usr/local/var/www/netmrg/include/config.php on line 75

This, I believe, is being caused by the fact that my fileroot GLOBAL isn't being set properly at line 1289 (or close to that line. I may have modified that file in testing) in lib/processing.php

$GLOBALS["netmrg"]["fileroot"] = $xmlconfig["NETMRG"][0]["PATHS"][0]["WEBFILEROOT"][0]["VALUE"];

I can code a little, and I've done some `print` testing at various points, and none of the .xml file config vars are getting populated correctly, but I receive no XML or PHP errors on the web page or in my apache2 logs.

Here is my software environment

# uname -a
Linux isaac 2.6.9-gentoo-r1 #1 Sat Nov 13 015909 EST 2004 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux

* net-www/apache
Latest version available 2.0.52-r1
Latest version installed 2.0.52-r1
Size of downloaded files 6,779 kB
Homepage http//www.apache.org/
Description Apache Web Server, Version 2.0.x
License Apache-2.0

* dev-php/php
Latest version available 4.3.9
Latest version installed 4.3.9
Size of downloaded files 3,908 kB
Homepage http//www.php.net/
Description PHP Shell Interpreter
License PHP-3

* dev-php/mod_php
Latest version available 4.3.9
Latest version installed 4.3.9
Size of downloaded files 3,908 kB
Homepage http//www.php.net/
Description Apache module for PHP
License PHP-3

* dev-libs/libxml2
Latest version available 2.6.15-r1
Latest version installed 2.6.15-r1
Size of downloaded files 2,844 kB
Homepage http//www.xmlsoft.org/
Description Version 2 of the library to manipulate XML files
License MIT

Any ideas??

silfreed

15-11-2004 10:26:22

How modularized is PHP in Gentoo? I know on other distributions, we need a package similar to '[bae8733f8bb]php-xml[/bae8733f8bb].' Does something like this exist for Gentoo as well?

-Doug

trevarthan

15-11-2004 11:14:42

No. There is a dev-php/phpxmlrpc, but that is not what we're looking for, I think.

I've watched the PHP build process on my Gentoo machine, and it configures with --with-xml.

silfreed

15-11-2004 15:15:49

First order of business is to locate the [i5e1894f84a]include/config.php[/i5e1894f84a] file and verify that the [b5e1894f84a]$prefix[/b5e1894f84a] variable is correct, and that the [b5e1894f84a]$GLOBALS["netmrg"]["xmlfile"][/b5e1894f84a] points to the correct file with your configured prefix.

Next is to check the syntax of your xml config file. On my linux boxes, I have a command called [i5e1894f84a]xmlwf[/i5e1894f84a] that will check if your xml file is 'well formed.' It's usually called something like the following
[code15e1894f84a]$ xmlwf /usr/local/etc/netmrg.xml
$ echo $?[/code15e1894f84a]
The command doesn't output anything, so the [i5e1894f84a]echo $?[/i5e1894f84a] should echo '0' if there were no errors,

If that's fine, we'll need to see if we're even parsing your file correctly. In the 'lib/processing.php', locate the function [i5e1894f84a]GetXMLConfig()[/i5e1894f84a]. After the line
[code15e1894f84a]$xmlconfig = GetXMLTree($GLOBALS["netmrg"]["xmlfile"]);[/code15e1894f84a]
add,
[code15e1894f84a]var_dump($xmlconfig);[/code15e1894f84a]
and refresh your browser. The output of this is potentially sensitive, so you will either want to edit the output before posting, or email it to me directly.

-Doug

trevarthan

15-11-2004 23:29:27

1.) $prefix = "/usr/local";
2.) $GLOBALS["netmrg"]["xmlfile"] = "${prefix}/etc/netmrg.xml";
(and that is correct)

3.) # xmlwf /usr/local/etc/netmrg.xml
/usr/local/etc/netmrg.xml2314 not well-formed (invalid token)

BINGO! This should be in the install doc somewhere. I kept thinking this might be the problem last night, but I wasn't sure because I didn't know how to verify the xml file.

Thanks! It works now!