php-windows Digest 1 Aug 2003 12:52:23 -0000 Issue 1848

Topics (messages 20959 through 20975):

Re: Q on PHP 4.3.2 & Apache 2.0.43
        20959 by: jsWalter
        20960 by: Sek-Mun Wong
        20961 by: jsWalter
        20962 by: Sek-Mun Wong
        20963 by: Sek-Mun Wong
        20964 by: jsWalter

I Need Some Help please
        20965 by: Dean Hayes
        20967 by: Voodoo
        20973 by: Mikey
        20974 by: Mikey

Re: Session not working
        20966 by: Voodoo

Re: Failure remote includes
        20968 by: m.r.
        20970 by: Sek-Mun Wong

Re: E-Mail Attachments...
        20969 by: Per Lundberg

Re: Web pages not being displayed
        20971 by: Greg Whitehead

Re: PHP Script for Mysql
        20972 by: Mikey

Unable To COnnect To FastCGI Server
        20975 by: Ashish Borkar

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
"Sek-Mun Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> red herring!

well, wild goose maybe.


> those are Apache directives you've listed,

right


> not php.ini settings.

right


> I assume you mean php.conf which is included by httpd.conf?

Right again.



>
> I assume you know how to install php as a SAPI module (you've got all the
> directives below plus the help url)

I can only assume you are refering to...

    LoadModule php4_module "/etc/php/sapi/php4apache2.dll"


<snip copied docs>

> #  > cli/php -r 'readfile("http://pear.php.net/go-pear";);' > go-pear

Yes, thank you for that walk through.

I'm not looking for the command line version.

I'm asking why the web version gives me CGI error.

If I comment out a few lines in the go-pear, it works fine, I get the web
version.

I just would like to know why it thinks I'm in CGI mode. In fact, I'd like
to know how to tell if I'm in CGI mode or SAPI mode.

Thanks

Walter




--- End Message ---
--- Begin Message ---
ah yes... sorry bout that... the other reply threw me off track ;-)

this is in the go-pear script for detecting sapi. as for why go-pear doesn't
like CGI your guess is as good as mine.

I suspect this is problematic.

In fact I thought the cli version had some minor bugs in it too for win32,
but it worked overall.

/*
 * Try to detect the kind of SAPI used by the
 * the given php.exe.
 * @Author Pierrre-Alain Joye
 */
function win32DetectPHPSAPI()
{
    global $php_bin;
    if($php_bin!=''){
        exec($php_bin.' -v', $res);
        if(is_array($res)) {
            if( isset($res[0]) && strpos($res[0],"(cli)")) {
                return 'cli';
            }
            if( isset($res[0]) && strpos($res[0],"cgi")) {
                return 'cgi';
            } else {
                return 'unknown';
            }
        }
    }
}


"Jswalter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Sek-Mun Wong" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > red herring!
>
> well, wild goose maybe.
>
>
> > those are Apache directives you've listed,
>
> right
>
>
> > not php.ini settings.
>
> right
>
>
> > I assume you mean php.conf which is included by httpd.conf?
>
> Right again.
>
>
>
> >
> > I assume you know how to install php as a SAPI module (you've got all
the
> > directives below plus the help url)
>
> I can only assume you are refering to...
>
>     LoadModule php4_module "/etc/php/sapi/php4apache2.dll"
>
>
> <snip copied docs>
>
> > #  > cli/php -r 'readfile("http://pear.php.net/go-pear";);' > go-pear
>
> Yes, thank you for that walk through.
>
> I'm not looking for the command line version.
>
> I'm asking why the web version gives me CGI error.
>
> If I comment out a few lines in the go-pear, it works fine, I get the web
> version.
>
> I just would like to know why it thinks I'm in CGI mode. In fact, I'd like
> to know how to tell if I'm in CGI mode or SAPI mode.
>
> Thanks
>
> Walter
>
>
>


--- End Message ---
--- Begin Message ---
So, we mark this down as a bug in the go-pear web-access script?

Walter




--- End Message ---
--- Begin Message ---
> I can only assume you are refering to...
>
>     LoadModule php4_module "/etc/php/sapi/php4apache2.dll"
>

oops just spotted this... maybe this is the issue? the function might not
like what apache2/win32 returns. fwiw I've gone back to 1.3.28 on win32.
Don't really need apache2... yet.


--- End Message ---
--- Begin Message ---
Well, it works for me under 1.3.28, so let me walk through your apache
config.

I'm sure there are issues with the script to say the least, but just one
more try with apache2:

Your httpd.conf:
1) remove these lines
    LoadFile "/etc/php/php4ts.dll"
    Action application/x-httpd-php "/etc/php/php.exe"
    LoadModule php4_module "/etc/php/sapi/php4apache2.dll"

2) add these lines:
    LoadModule php4_module "c:/php/sapi/php4apache2.dll" (or wherever ur
sapi is)
    AddType application/x-httpd-php .php .phtml

3) copy php4ts.dll to C:\WINDOWS\SYSTEM32

3a) do a "apache -t" test your conf

4) restart apache

give that a go and see what happens

"Jswalter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> So, we mark this down as a bug in the go-pear web-access script?
>
> Walter
>
>
>


--- End Message ---
--- Begin Message ---
"Sek-Mun Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > I can only assume you are refering to...
> >
> >     LoadModule php4_module "/etc/php/sapi/php4apache2.dll"
> >
>
> oops just spotted this... maybe this is the issue? the function might not
> like what apache2/win32 returns. fwiw I've gone back to 1.3.28 on win32.
> Don't really need apache2... yet.

OK, now we're getting somewhere!

At the top of the code it is looking at...

   $sapi_name = php_sapi_name();   [returns 'apache2handler']

and

   ($_SERVER['GATEWAY_INTERFACE']     [returns 'CGI/1.1']

Then, at the "problem" area (both of them...

   $php_sapi_name = win32DetectPHPSAPI();    [kills test script, no error]

Well, the script runs now, but only after I commented out the CGI check
sections (both of them)

So it works, but it's not perfect.  :/

Walter




--- End Message ---
--- Begin Message ---
Hey,

I am doing a script that calls items from a MySQL database. The Database holds as many rows of information as the user has entered into it what i need to do is call information from a list of different rows like 3 to 5 or 3 to 15 how ever many the user wants. Is there a way i can use a script to get this at all?

Thanks



Dean "The Insane Guy" Hayes
Mystical Web Designs
http://www.mystical-sector.com

<-- I design and i redesign but still i never designed true beauty like you -->

_________________________________________________________________
ninemsn Extra Storage is now available. Get larger attachments - send/receive up to 3MB attachments (up to three times more per e-mail). Click here http://join.msn.com/


--- End Message ---
--- Begin Message ---
I don't know if I understood what you mean (english isn't my mother
language) but I think you can use the mysql_num_rows function to create a
loop. If you got the variable $query as the result of a db research, use
something like:

for ($i=0; $i<mysql_num_rows($query); $i++){
$row[$i]=mysql_fetch_array($query);
}

Hope this is what you want.

Cheers

Voodoo



--- End Message ---
--- Begin Message ---
It's not really a PHP solution, but if you add LIMIT off, rows (where off is
the offset from the start (0) and rows is the number of rows you want
returned) to your query, that should do what you require.

HTH,

Mikey

> -----Original Message-----
> From: Dean Hayes [mailto:[EMAIL PROTECTED]
> Sent: 01 August 2003 05:33
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] I Need Some Help please
>
>
>
> Hey,
>
> I am doing a script that calls items from a MySQL database. The Database
> holds as many rows of information as the user has entered into it what i
> need to do is call information from a list of different rows like
> 3 to 5 or
> 3 to 15 how ever many the user wants. Is there a way i can use a
> script to
> get this at all?
>
> Thanks
>
>
>
> Dean "The Insane Guy" Hayes
> Mystical Web Designs
> http://www.mystical-sector.com
>
> <-- I design and i redesign but still i never designed true
> beauty like you
> -->
>
> _________________________________________________________________
> ninemsn Extra Storage is now available. Get larger attachments -
> send/receive up to 3MB attachments (up to three times more per e-mail).
> Click here  http://join.msn.com/
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
(Keep your mails on the list as others may benefit)

I am assuming that you already have a script that is doing a SELECT
statement?  If so, then modify your SELECT like so:

SELECT * FROM test_table LIMIT 0, 4
                         ^^^^^^^^^^

This will bring back the first 4 rows of your query

SELECT * FROM test_table LIMIT 4, 4
                         ^^^^^^^^^^

Will bring back the next for rows, and so on...

HTH,

Mikey

> -----Original Message-----
> From: Dean Hayes [mailto:[EMAIL PROTECTED]
> Sent: 01 August 2003 12:51
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] I Need Some Help please
>
>
>
>
> I Am Sorry i did not understand what u ment by that as i am a
> newbie to PHP
> and MySQL could you show me an example of the script so i can understand
> what you mean.
>
> Thanks
>
> Dean "The Insane Guy" Hayes
> Mystical Web Designs
> http://www.mystical-sector.com
>
> <-- I design and i redesign but still i never designed true
> beauty like you
> -->
>
>
>
>
>
> From: "Mikey" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP-WIN] I Need Some Help please
> Date: Fri, 1 Aug 2003 12:46:31 +0100
>
> It's not really a PHP solution, but if you add LIMIT off, rows
> (where off is
> the offset from the start (0) and rows is the number of rows you want
> returned) to your query, that should do what you require.
>
> HTH,
>
> Mikey
>
>  > -----Original Message-----
>  > From: Dean Hayes [mailto:[EMAIL PROTECTED]
>  > Sent: 01 August 2003 05:33
>  > To: [EMAIL PROTECTED]
>  > Subject: [PHP-WIN] I Need Some Help please
>  >
>  >
>  >
>  > Hey,
>  >
>  > I am doing a script that calls items from a MySQL database.
> The Database
>  > holds as many rows of information as the user has entered into
> it what i
>  > need to do is call information from a list of different rows like
>  > 3 to 5 or
>  > 3 to 15 how ever many the user wants. Is there a way i can use a
>  > script to
>  > get this at all?
>  >
>  > Thanks
>  >
>  >
>  >
>  > Dean "The Insane Guy" Hayes
>  > Mystical Web Designs
>  > http://www.mystical-sector.com
>  >
>  > <-- I design and i redesign but still i never designed true
>  > beauty like you
>  > -->
>  >
>  > _________________________________________________________________
>  > ninemsn Extra Storage is now available. Get larger attachments -
>  > send/receive up to 3MB attachments (up to three times more per e-mail).
>  > Click here  http://join.msn.com/
>  >
>  >
>  > --
>  > PHP Windows Mailing List (http://www.php.net/)
>  > To unsubscribe, visit: http://www.php.net/unsub.php
>  >
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> _________________________________________________________________
> ninemsn Extra Storage is now available. Get larger attachments -
> send/receive up to 3MB attachments (up to three times more per e-mail).
> Click here  http://join.msn.com/
>


--- End Message ---
--- Begin Message ---
I was having troubles with my session.save_path configuration. It is solved
now.

Thanks to all,

Voodoo



--- End Message ---
--- Begin Message ---
skate wrote 31 7 2003 14:11 Re: [PHP-WIN] Failure remote includes:
<...you tried ...

<?php include('http://somedomain.com/index.html');  ?>

would it not be more beneficial to open the files (fopen, fread)? this way
you can parse the page if needed, and add your own headers / footers without
killing any HTML...>
_______________________
Thanks, but whatever I try to accomplish with remote files fails. Besides,
for other reasons I need to have the remote includes working. I guess they
maybe fixed remote access in 4.3 but the problem came back in versions after
4.3
Anyone got this working under Apache 1.3? 

Thanks for your help!




--- End Message ---
--- Begin Message ---
silly one but i assume you already have "allow_url_fopen=On" in php.ini? (it
should tell you anyway, that this is not set, plus the error below)

works for me in 4.3.2/winxp pro/apache 1.3.28.

I guess if you don't *need* apache 2, don't do it.

another test might be to fopen and read a socket via http to make sure your
connection (or I should say apache's service logon user's connection) to the
aforementioned ip/host is ok.


"M.R." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PHP 4.3.2, Apache 2.0.47, Windows XP Pro
>
> PHP includes of remote files like
> <?php include('http://somedomain.com/');  ?>
> give error  Failed opening 'http://somedomain.com/' for inclusion
>
> includes of local files like
> <?php include('test.txt');  ?>
> no problem.
>
> The problem with inclusion of remote files was supposedly solved with PHP
> 4.3.0, but still seems a problem, at least on Apache 2.0.47. Is there any
> setting I should look into? Any ideas/help most welcome!
>


--- End Message ---
--- Begin Message ---
On Thu, 2003-07-31 at 19:14, Guru wrote:
> Hi,
> 
> Are there any efficient ways fo attaching files to e-mails and sending them
> using mail() function... please help 

Try phpmailer.  http://phpmailer.sf.net
--
Best regards,

Per Lundberg / Capio ApS
Phone: +46-18-4186040
Fax: +46-18-4186049
Web: http://www.nobolt.com

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Hi All

though i would share my knowledge with you i found after pulling the whole
system apart and testing each module that the apache server 2.0.13 was
causing my grief and by installing the apache 1.13 was able to solve the
problem.


thanks for the responses i got
Greg Whitehead


"Greg Whitehead" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All
>
> I could use some help. I have a problem with which I am not sure if its
> PHP4.3.2, MySQL4.0.13 or Apache2.0.46 all running on windows XP.
> The problem is I have a web page that shows a list of data (20 items) from
> MySQL database using PHP script and I get varying results when I view this
> page:
>
> page displays normally (very seldom).
> page displays header only.
> page displays nothing (most commonly).
> page displays a few entries then stops.
> page displays the page with some weird code being displayed beside the
> header (uppercase P and square box with a ? following).
>
> MySQL logs don't show any problem accessing the data.
>
> I have tried using the both Internet Explorer and Netscape, both browsers
> give similar problems. Netscape seems to more tolerant than Explorer.
> Continued refreshing will get the page to eventually display in Netscape
but
> this does not happen with Explorer.
>
> Anyone have any ideas what might be my problem ?
>
> Thanks in Advance
>
> Greg Whitehead
>
>



--- End Message ---
--- Begin Message ---
All you need to do is insert the user into the user table in your main mysql
database.  Then, if you want to add them to your database, insert another
line into the db table.  The column names are fairly descriptive, so I won't
go into any detail here...

HTH,

Mikey

> -----Original Message-----
> From: The.Rock [mailto:[EMAIL PROTECTED]
> Sent: 31 July 2003 23:57
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] PHP Script for Mysql
>
>
> Don't know if this is possible but....
>
> Is it possible to create a PHP script to create a user in MySQL
> database and
> then grant that user specific access to the DB? I'm trying to create an
> installer for a php program and building it so that dummies can install it
> if need be.
>
> I know that PHPMyAdmin creates users with an interface, but I'm
> just trying
> to do this by having the user go to
> www.server.com/program/install.php , and
> this would setup the user account, grant access and then install the
> program.
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
I am getting the following error message on my browser when i execute 
a PHP script.
         Unable T o Connect to FastCGI Server.
What can be the Reason?
Regards
Ashish 
        


         

--- End Message ---

Reply via email to