Click to See Complete Forum and Search --> : PHP, Apache, Mail() is driving me crazy!


Anon
09-26-2001, 04:38 PM
I have a problem with Apache1.3.19/Win2k/ and PHP/4.0.4pl1 running a mail script.

I have narrowed it down. If use CGI based php with httpd.conf:

#for the cgi binary (you can use that one compiled with force cgi redirect too)
ScriptAlias /php4/ "D:/Program Files/Apache Group/Apache/php/"
Action application/x-httpd-php4 "/php4/php.exe"
AddType application/x-httpd-php4 .php

Everything's fine except in running scripts, all scripts "work" except for trying to access mail, i get the "Failed to connect".

So, per newsgroups I do the preferred "Load Module" and # out the CGI extentsions from above and instead include this in httpd.conf:

LoadModule php4_module "d:/program files/apache group/apache/php/sapi/php4apache.dll"
AddType application/x-httpd-php .php4

I do this, and the parser doesnt even work, i get html form elements surrounded by unparsed characters......ARRRRRRRRRRRGGGGG

WTF!!! dude, HELP! I know I should be using the LoadModule version, not only cuz folks say it makes the mail() work, but also due to security.

DO i have a currupted php4apache.dll?

Is there another httpd.conf line I am missing? (not per the install.txt for php)

Help!

Anon
09-26-2001, 04:50 PM
Sorry this

"Everything's fine except in running scripts"

should read this.

"Everything is fine in running scripts."

Anon
09-30-2001, 01:41 PM
...
group/apache/php/sapi/php4apache.dll"
...

For some odd reason it didn't work for me either from withing php/sapi/ directory. I moved php4apache.dll to php/ and it worked nicely. I haven't pondered over the reason afterwards so I can't really tell why it's being so picky.

gardner1
09-30-2001, 05:09 PM
Sven,

I found out that problem.

here is the excerpt of a dialogue with a friend, he is a Linux/Apache stud, and with his help I figured out the root cause being one of two things. DONT USE THE PL versions. use only stables, ie. 4.0.6

******
Duly noted, LOL!

I think this was the prob...just in case anyone else you hear has similar probs.

mail() doesnt seem to work correctly under CGI extension, but does work under Load Module. Problem is, if you use the .msi installer (which is what came with my book) it doesnt load correctly...see this note from php.net(not the ZIP file has "CGI binary plus server API versions for Apache" and the installer is "CGI only")grr:

Windows Binaries
All Windows binaries can be used on Windows 95/98/Me and on Windows NT/2000.
PHP 4.0.6 zip package [4,859Kb] - 23 June 2001
(CGI binary plus server API versions for Apache, AOLserver, ISAPI and NSAPI. MySQL support built-in, many extensions included, packaged as zip)
PHP 4.0.6 installer [755Kb] - 23 June 2001
(CGI only, MySQL support built-in, packaged as Windows installer to install and configure PHP, and automatically configure IIS, PWS and Xitami, with manual configuration for other servers. N.B. no external extensions included)

After all that, and sticking this that and the other thing in the conf file, i was getting all sorts of weird errors making diagnostics a *****...so i finally RTFM slowly and methodically and caught that nugget of info, extracted the zip in, did all the other install tasks, and wham-o it worked, PHEW!

Apprectiate the help...talk to ya soon.
********

So, though I suppose you have it working nicely now, IF you loaded PHP via an installer you might want to go back and hand install it with the ZIPPED stable release.

If you recall, the installer walks you through and asks you questions. I think when it did this is may be creating a false registry entry. Much better to put the Windows blinders on, and treat it as if you were installing on a Unix system, ie, install it, and configure the php.ini and httpd.conf by HAND.

Here are the entries for httpd.conf:

LoadModule php4_module "d:/program files/apache group/apache/php/sapi/php4apache.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Notice it IS working for me in the sapi directory.

That's for the note though.

Cheers.

Anon
10-01-2001, 11:55 AM
I installed firstly .msi and later updated from .zip to get ISAPI version. I also edited configuration files manually. Still it doesn't work from withing /php/sapi/.

But I'm not really worried, everything works just fine for me. I'm using it as development environment and everything works smooth as silk. But thanks for the info, when I happen to reinstall, I'll try to install it as advised.