Skip to main content.
home | support | download

Back to List Archive

(no subject)

From: King, Nigel <Nigel.King(at)not-real.nuth.nhs.uk>
Date: Mon Nov 27 2006 - 14:57:17 GMT
I have a problem in using Swish-e 2.4.4 in conjunction with PHP 5.1.1.

=20

I have been using PHP successfully on our Solaris 9 system under Apache
2.2.0 and so I know that works.

=20

I have listed below a sample php file I wish to index, the swish-e
configuration file I am using, and the html=20

Generated from the same php file by using the command line=20

=20

/usr/local/bin/php updateMe.php

=20

The command=20

'swish-e -v3 -c test.conf'

=20

Produces the output

=20

Parsing config file 'test.conf'

Indexing Dat Source: "File-System"

Indexing "/export/home/intranet/comp"

=20

Checking dir "export/home/intranet/comp" . . .

                        updateMe.phpBus Error - core dumped

=20

If I replace the file updateMe.php with the html code as updateMe.html I
get

=20

Parsing config file 'test.conf'

Indexing Dat Source: "File-System"

Indexing "/export/home/intranet/comp"

=20

Checking dir "export/home/intranet/comp" . . .

                        updateMe.html - Using DEFAULT (HTML2) parser -
(58 words)

=20

In dir "/export/home/intranet/comp/links":

=20

In dir "/export/home/intranet/comp/fun":

            Teamrole.phpBus Error - core dumped

=20

Renaming the html file as a php file causes the first output. =20

=20

So, the php module works, and swish-e can handle the html produced by
the php module but cannot seem to handle the standard output of the php
module.

=20

Any ideas what I'm doing wrong?

=20

Thanks.

=20

NDK

=20

=20

HERE IS THE PHP FILE

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

<?php=20

            define( 'TITLE', 'Update Me' );

            require 'banner.php';=20

            require 'retrieve.php';=20

?>

=20

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en" =
lang=3D"en">

<head>

<?php

            printf( '<title>Computing Section - %s</title>', TITLE );

?>

            <link rel=3D"stylesheet" type=3D"text/css" =
href=3D"compstyle.css"
/>

</head>

<body>

<?php=20

            showBanner();

            printf( '<h1>%s</h1>', TITLE );

=20

            if ( ! isset( $_POST[ 'updateMe' ] ) ) {

                       =20

                        $STATE =3D 0;

                        $updateMe =3D '';

           =20

            } else {

                       =20

                        $updateMe =3D $_POST[ 'updateMe' ];=20

                        if ( is_null( $_POST[ 'updateMe' ] ) )

                                    $STATE =3D 1;

                        else if ( $_POST[ 'updateMe' ] =3D=3D '' )

                                    $STATE =3D 1;

                        else if ( preg_match(
'/^([^.@]+\.)+[^.@]+\@([^.@]+\.)+$/', $_POST[ 'updateMe' ] ) )

                                    $STATE =3D 1;

                        else {               =20

                                   =20

                                    // file the email address

                                    $link =3D mysql_connect("localhost",
"intranet", "webpages") or die("Could not connect");

                                    mysql_select_db("website") or
die("Could not select database");

                                   =20

                                    /* Performing SQL query */

                                    $query =3D sprintf( "INSERT `update`
SET `index`=3DNULL, `email`=3D'%s';", $updateMe );

                                    $result =3D mysql_query($query) or
die("Query failed.  Contact Computing.");

                                    $STATE =3D 2;

                                   =20

                        } // else

           =20

            } // else

           =20

            if ( $STATE =3D=3D 2 ){

           =20

                        ?>

                        <p>Thank you for registering.  You will be
notified automatically by email to <b><?php echo $updateMe; ?></b>
whenever there is news.</p>

                        <?php

           =20

            } else {

           =20

                        ?>

                        <p>Fill in the details below then click on
submit.  You will be sent an email message when the site is changed.</p>


                        <form method=3D"post" action=3D"">

                        Please enter your email address: <input
name=3D"updateMe" type=3D"text" size=3D"40" value=3D"<?php echo =
$updateMe;
?>"/><input type=3D"submit" value=3D"Submit"/>

                        </form>

                        <?php

                        if ( $STATE =3D=3D 1 )

                                    echo '<span style=3D"color:
red;">There is something wrong with your email address.</span>';=20

           =20

            } // else

            ?>

</body>

=20

HERE IS THE HTML CODE GENERATED BY PHP

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en" =
lang=3D"en">

<head>

<title>Computing Section - Update Me</title>    <link rel=3D"stylesheet"
type=3D"text/css" href=3D"compstyle.css" />

</head>

<body>

<a name=3D"banner_top"></a>

<div style=3D"float: right; width: 100%; margin-bottom: 2ex;
padding-bottom: 5px; border-bottom: solid silver 1px;">

<img src=3D"/images/nhs.gif" width=3D"60" height=3D"24" style=3D"float: =
right;"
alt=3D"NHS logo image" />

<div style=3D"float: right; font-size: 10pt; font-weight: bold; color:
navy; margin-bottom: 1ex; margin-right: 2ex;">

RMPD <span class=3D"logo2">Computing</span> NGH<br />Phone: <span
class=3D"logo2">22634</span></div>

<div style=3D"text-align: right; font-weight: normal; float: right;
margin-right: 14ex;">

<a class=3D"small" href=3D"/" >Unit Home</a> |=20

<a class=3D"small" href=3D"/comp/" >Computing Home</a> |=20

<a class=3D"small" href=3D"http://www.rmpd.org.uk/" >RMPD Internet</a> | =


<a class=3D"small" href=3D"http://intranet/trust_intranet/default.htm"
>Trust Intranet</a>

</div>

<div style=3D"width: 100%; float: right; clear: both; font-size: 10pt;
font-weight: bold; text-align: right; line-height: 3.5ex;">=20

<span style=3D"background-color: white;"><a class=3D"light" =
href=3D"/comp/"
title=3D"The Computing Section's Home Page">&nbsp;Home&nbsp;</a></span>=20

<span style=3D"background-color: red;"><a class=3D"dark" =
href=3D"/comp/help/"
title=3D"Look here if you need help with a
problem">&nbsp;Help&nbsp;</a></span>=20

<span style=3D"background-color: orange;"><a class=3D"dark"
href=3D"/comp/services/" title=3D"Look here for a range of
services">&nbsp;Services&nbsp;</a></span>=20

<span style=3D"background-color: yellow;"><a class=3D"light"
href=3D"/comp/information/" title=3D"Look here to find things
out">&nbsp;Information&nbsp;</a></span>=20

<span style=3D"background-color: green;"><a class=3D"dark"
href=3D"/comp/links/" title=3D"A collection of useful
links">&nbsp;Links&nbsp;</a></span>=20

<span style=3D"background-color: blue;"><a class=3D"dark" =
href=3D"/comp/fun/"
title=3D"Fun things to do, some of which are
useful">&nbsp;Fun&nbsp;</a></span>=20

<span style=3D"background-color: indigo;"><a class=3D"dark"
href=3D"/comp/downloads/" title=3D"Various useful
downloads">&nbsp;Downloads&nbsp;</a></span>=20

<span style=3D"background-color: violet;"><a class=3D"dark"
href=3D"/comp/search.php" title=3D"Find what you want on this
site">&nbsp;Search&nbsp;</a></span>

</div>

<div style=3D"float: right; width: 100%; text-align: right;clear: =
both;">

Location: Update Me

</div>

</div>

<div class=3D"totop">

<a class=3D"light" href=3D"updateMe.php#banner_top" title=3D"This works
properly in Opera and Firefox! See Downloads.">to top</a>

</div>

<h1>Update Me</h1>              =20

<p>Fill in the details below then click on submit.  You will be sent an
email message when the site is changed.</p>

                        <form method=3D"post" action=3D"">

                                                Please enter your email
address: <input name=3D"updateMe" type=3D"text" size=3D"40" =
value=3D""/><input
type=3D"submit" value=3D"Submit"/>

                                    </form>

                </body>

=20

HERE IS THE CONFIGURATION FILE I'M USING

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

IndexDir /export/home/intranet/comp

IndexFile /export/home/intranet/comp.index

IndexDir /export/home/intranet/comp

IndexDir /export/home/intranet/comp

IndexFile /export/home/intranet/comp.index

IndexName "Index of http://alpha1/"

IndexDescription "This is an index of the RMPDNGH Computing Website."

IndexPointer "http://alpha1/"

IndexAdmin "Nigel King, (nigel.king@nuth.nhs.uk)"

MetaNames first author

IndexReport 1

FollowSymLinks yes

FuzzyIndexingMode Stemming_en1

IgnoreTotalWordCountWhenRanking yes

ReplaceRules replace "/export/home/intranet" "http://alpha1"

IndexComments 0

IndexOnly .htm .html .shtm .shtml .php

FileFilter .php /usr/local/bin/php "'%p'"

NoContents .gif .xbm .au .mov .mpg .pdf .ps

FileRules pathname contains images wmtools apache-indices cgi-bin
downloads etc

FileRules filename contains index search banner

FileRules filename contains # % ~ .bak .orig .old old.

FileRules title contains construction example pointers

FileRules directory contains .htaccess

FileRules filename is forbidden.html unavailable.html unsupported.html
phpinfo.php

=20

=20




*********************************************************************
Due to deletion of content types excluded from this list by policy,
this multipart message was reduced to a single part, and from there
to a plain text message.
*********************************************************************
Received on Mon Nov 27 06:57:41 2006