Skip to main content
GameDev.net gamedev.net
🔒 Locked

Apache 2.0.43 + PHP4+win98

Started by nick316 Jan 6, 2003 at 7:18 PM 17 replies 500+ views
Original Post
nick316
nick316
Has anyone had any luck getting these to work together. After many hours of searching the web and about 5 installs it appears that these do not work together.
Evil Bill
Evil Bill
I'm using Apacke 1.3.27 under Win98SE (although i use C++ for CGI, not Perl) and it wors fine.

What do you mean it doesn't work? Does Apache complain? What does it say?



[edited by - Evil Bill on January 6, 2003 8:31:12 PM]
Member of the Unban Mindwipe Society (UMWS)
Michalson
Michalson
Welcome to the world of open source software

Here are the possible responses you can expect from those in the know:

  1. RTFM n00b
  2. STFW n00b
  3. STFU n00b
  4. M$ Windoze? Install a real operating system like Linux [sic] you n00b


I would suggest asking Evil Bill what his Apache config file looks like (specifically the lines he used to get PHP to run without crashing Apache)
nick316
nick316
This is the error message.

[Mon Jan 06 20:39:50 2003] [error] [client 127.0.0.1] Premature end of script headers: php.exe

I would appreciate seeing someones httpd.conf file.
Especially the part where you load and add the modules.

Don''t make me install win2000 with IIS.

Evil Bill
Evil Bill
Well, i just upgraded to v2.0.43.

I can''t read. I read "PHP4" as "Perl". You can get my httpd.conf file Here Although it hasn''t changed at all from the installation.

Member of the Unban Mindwipe Society (UMWS)
nick316
nick316
I have the apache working but it''s the php that doesn''t
work. You are not using php but thank you for posting the link.
Evil Bill
Evil Bill
I don''t know anything about PHP, but do you need to echo a "Content-Type: text/html\n\n" line?

Because, if you do - and don''t - that''d probably give an error like that.
Then again, i could be wrong.

Member of the Unban Mindwipe Society (UMWS)
Crazy_Vasey
Crazy_Vasey
Apache 2 and PHP don''t play together very well as a rule, you''re better off sticking to 1.3.x IMO
kingy
kingy
Just use win2k and IIS instead...

Spectre Software - RPGs, strategy, puzzle games, programming
“If you try and please everyone, you won’t please anyone.”
Burning_Ice
Burning_Ice
hmm i had no trouble at all getting this to run. i just added

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

to the httpd.conf. of course substitute c:/php/ with your php path. also make sure that php.ini is in your windows directory.

hope that helps

Edit: i just see that i have version 2.0.37 installed, but that's not too old so there should be no major changes



Runicsoft -- home of my open source Function Parser and more

[edited by - Burning_Ice on January 7, 2003 9:10:55 AM]
superpig
superpig
What script are you trying to run?

Your test script should be this:

<?php
phpinfo();
?>



Superpig
- saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery.

[edited by - Superpig on January 7, 2003 9:50:29 AM]
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
CWizard
CWizard
quote:
Original post by Evil Bill
I don't know anything about PHP, but do you need to echo a "Content-Type: text/html\n\n" line?
No, you don't need that.
quote:
Original post by Crazy_Vasey
Apache 2 and PHP don't play together very well as a rule, you're better off sticking to 1.3.x IMO
Apache 2 and PHP 4 works find together if you get it right. I've used them on windows production servers for over a year with no problems, except a nasty bug in the image library.
quote:
Original post by kingy
Just use win2k and IIS instead...
I could never recommend IIS. Not primarily due to its bad security, but because it is so annoying to configure.
quote:
Original post by Burning_Ice
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

to the httpd.conf. of course substitute c:/php/ with your php path. also make sure that php.ini is in your windows directory.
Only do this if you are installing PHP as CGI-executable. It sounded like you were installing it as an apache module, which is much better and nicer. To install it as a module, download and unpack the zipped windows distro of PHP and follow the instructions in the readme for Apache 1.3. In short, you should:
* Copy php4apache2.dll to apache's modules directory.
* Insert a "LoadModule php4_module modules/php4apache2.dll" directive in httpd.conf.
* Also add "AddType application/x-httpd-php .php"
* Modify the DirectoryIndex directive to include index.php
* You should throw a copy of "php4ts.dll" into \Windows\System32.
* Edit the php.ini file so the paths are correct, and throw it in \Windows.
* Restart Apache.

If you get errors then (about incompatibilities), you're screwed . Nah, you need to get a newer version of PHP, which is usually found in the snapshots archive. But that might fail as well; it did last time I installed it.

To avoid that mess, you should build both Apache and PHP yourself, which can be a headache on Windows. The above described icompatibility is caused by php4apache2.dll being compiled with another version of Apache, which is solved if you compile it with the exact same version you're using.

You'll probably be better off resorting to the users@httpd.apache.org or a php mailing list.

Btw, I would never dare to run Apache on 98; I only run it on Windows 2000/XP, or Linux.




[edited by - CWizard on January 7, 2003 12:10:45 PM]
nick316
nick316
quote:
Original post by Evil Bill
To install it as a module, download and unpack the zipped windows distro of PHP and follow the instructions in the readme for Apache 1.3. In short, you should:
* Copy php4apache2.dll to apache's modules directory.
* Insert a "LoadModule php4_module modules/php4apache2.dll" directive in httpd.conf.
* Also add "AddType application/x-httpd-php .php"
* Modify the DirectoryIndex directive to include index.php
* You should throw a copy of "php4ts.dll" into \Windows\System32.
* Edit the php.ini file so the paths are correct, and throw it in \Windows.
* Restart Apache.





[edited by - CWizard on January 7, 2003 12:10:45 PM]


I tried exactly what you said and it's still fucked.
You would think these companies would have their act together by now.

[edited by - nick316 on January 7, 2003 6:33:35 PM]
CWizard
CWizard
quote:
Original post by nick316
I tried exactly what you said and it''s still fucked.
Fucked in what way? Does Apache start or barf? Any messages?
quote:
You would think these companies would have their act together by now.
Perhaps, but they are independent of eachother. The problems with PHP and Apache usually arises when you try to use the precompiled binaries, which few *nix users do, which in turn are their primary targets. I know there is one or more maintained Apache2-with-PHP4-for-Win32 precompiled packages, they have been linked to numerous times on the users@httpd.apache.org mailing list, but I can''t find any of those messages now.


nick316
nick316
Well, the error log says it worked but the window disappears
and it it doesn''t work from the browser.
It''s this line that kills it:
LoadModule php4_module c:/php/sapi/php4apache2.dll

Just for a laugh could someone post a link to this file for me
to download from there machine.

Thanks
Nick
CWizard
CWizard
I do never run Apache from the command line, only as a service, which I guess is hard in ''98.

"Window disappears"? Do you mean that you have some short cut that opens a command window that disappears immediatly? Then Apache barfs at your config, and is not running. Open up a command prompt window, cd to Apache''s bin directory and type apache.exe and note what it says.

Do php4apache2.dll exist in c:/php/sapi? If so, it''s probably incompatible with Apache 2.0.43. I''m currently running 2.0.42 (not using SSL, so no need to upgrade yet) works well with PHP 4.2.3.


nick316
nick316
I think you are right.
Can I have your php4apache.dll file.
superpig
superpig
Take a look at your ''experimental'' directory (you should have one).
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
CWizard
CWizard
quote:
Original post by superpig
Take a look at your ''experimental'' directory (you should have one).
It has been moved to the sapi dir since 4.2.1, I think. At least 4.2.3 has it in there.

Btw, my php4apache2.dll won''t do you any good.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.