
- You are not logged in. | Login
- Index
- » Discuss atricles
- » Discuss article: "Installation of PHP+Apache: CGI vs. module"
February 19, 2007 10:06 am
- admin
- Administrator


Discuss article: "Installation of PHP+Apache: CGI vs. module"
You can discuss this article here
Discussed article: "Installation of PHP+Apache: CGI vs. module"
March 26, 2007 12:48 pm
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Thanks! I’m going to try it. Especially as now I need to have PHP3 (for *.php3) and PHP4 (for *.php) at the same time. Something involving installation became clearer to me.
March 27, 2007 8:21 am
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
It works! Really 3 files are enough for installation.
The only thing I had to change is the string LoadModulephp4_module"f:/usr/local/php/php4apache.dll". I used variant with other slashes LoadModule php4_module"f:usrlocalphpphp4apache.dll" in the file httpd.conf . May be it is in my Apache version only: Apache/1.3.6 (Win32)?
Now both PHP3 (it haven’t worked before) and PHP4 (as a module). PHP3 handles *.php3 and PHP4 works with *.php like on my real site.
Unfortunately back slashes aren’t displayed.
March 27, 2007 8:30 am
- senjor_itc
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
I've found this method at once.
I even didn't know that it is going to work as Apache module. So I'm lucky in some sense.
March 27, 2007 8:52 am
- PilgrimFarAway
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
I'm tired with searching for module php4apache.dll
I already have got all the rest. Please, give me a link where to find it...
March 27, 2007 9:39 am
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Here is an example. It was tested on Apache 1.3.19 / mod_php 4.0.4pl1 / w2k
$fn="test.txt"; $fp=fopen($fn,"w"); for ($i=0;$i<256;$i++) fwrite($fp,chr($i)); fclose($fp); $fp=fopen($fn,"r"); $s=fread($fp,256); fclose($fp); echo filesize($fn)." ".strlen($s);
It displays quite the different things from what was expected (256 256). As it was proved by the experiment symbol EOF (code #1A) works exactly like EOF here. This involves all functions working with files – fgets, fread, file, readfile and so on. And as CGI everything works properly. But because of it I had to refuse delicious things of mod_php (the most delicious thing for me is the authorization ability by means of PHP).
Gentlemen, try to check it yourselves (both on w2k and w98 – I don’t have 98х
.
98 per cent of the example coincide with what you have.
I’ve tried to use binary mode (letter ‘b’ by opening) and everything started working.
Instead of $fp=fopen($fn,"w"); you are to write $fp=fopen($fn,"wb");
Instead of $fp=fopen($fn,"r"); you are to write $fp=fopen($fn,"rb");
Test it on your system.
March 27, 2007 9:56 am
- bandlist12
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
As a module it is installed properly but I've faced a problem: mail isn't sent via SMTP in spite of that SMTP-server is written correctly within php.ini There are not any problems with CGI.
I haven’t tested working abilities of other features and thus it is quite possible that something else is out of order… What can be wrong?
March 27, 2007 10:02 am
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
You haven't noticed quite the obvious things
It is written with fine font in the documentation...
I tried it with Linux yesterday - everything works properly
Couldn't they make binary mode on default? 
March 27, 2007 10:49 am
- sam43inwood
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
I have a very interestung situation. I had Apache 1.3.6. and PHP3 installed. Having read this article I decided to install PHP4 as a module. I downloaded distributive, unpacked it, recorded into the directory... I deleted all the old things related to the 3rd version from the Apache configuration. I start Apache as a console: everything works properly but in the error log it writes {file .mainhttp_main.c, line 5890, assertion "start_mutex" failed}. I try to start it as service and it displays error saying that it cannot start and it isn't notified in the service description string that it is started. BUT! Both Apache and PHP work. I've decided to check 'TEST' output from PHP itself (omitting Apache i.e. from the command string) - it displays nothing! I don't uderstand anything. Help me if you know how to deal with it...
March 27, 2007 11:07 am
- SRG
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
After the installation of Apache 1.3.6 and PHP 4.0.4 under w2k Apache began starting as console application only. When starting as service an error is displayed something like Apache writes into inadmissible memory area
March 27, 2007 2:12 pm
- purplebean
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Who would be so kind to educate me about joining of Apache+PHP (win) with Mysql (Linux)...? It doesn’t want to join. MySQL on Linux is assembled including 1251 support. So what does it want?
March 27, 2007 2:20 pm
- mastaweb99
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
It doesn't want to work as a module... I've tried everything... Version 4.0.5
Uder windows Apache displays an error
Can't load module ..blablabla./php4apache.dll A device attached to the system isn't functioning
What should I do? 
Last edited by mastaweb99 (March 27, 2007 2:21 pm)
March 27, 2007 2:26 pm
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Everything functions properly... My respect to PHP 4.0.5!!! 
March 27, 2007 2:47 pm
- mmwfan
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
As to the question 'windows vs. Unix' - how to make include and require under windows?
They don't want to work and developers in their manual write that it shouldn't work either.
That is the reason why windows becomes inconvenient to work under when creating a project which is at least a bit bigger than some John Smith's home page.
March 27, 2007 2:53 pm
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Why cannot you make include under windows? It is made exactly like in Unix or Linux: include("path/file.inc");
March 27, 2007 3:18 pm
- napkdd1
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
This all is rather interesting but such a question appears... Doesn't a person read install.txt file when he loads PHP-installation? Everything is written clearly there
Installtion instructions
------------------------
Apache:
1. Stop the Apache Webserver.
Edit the httpd.conf and put in these lines, modified to your environment:
# for the apache module
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php4
#for the cgi binary (you can use that one compiled with force cgi redirect too)
scriptAlias /php4/ "C:/php/"
Action application/x-httpd-php4 "/php4/php.exe"
AddType application/x-httpd-php4 .php
2. Unzip the Package to c:php, now move php4ts.dll to the windows/system(32) directory, overwritte any older file!
3. Copy the php.ini-dist to your sysroot (directory where you installed windows), rename it to php.ini, and
edit the php.ini to fit your needs.
4. Restart the Apache server.
I'm not going to find fault with anyone but I'm extremely surprised that most people actually don't read instructions...
March 27, 2007 3:39 pm
- bobbee
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
I’m very grateful to the author of this article and I want to say that everything works perfectly! It works exactly as written. From the first time without any problems! It would be good to have more such really useful articles!
It takes a lot of efforts by many people to solve such problems but at the same time they don’t like sharing their experience with others!
Thanks for the article! 
March 28, 2007 6:46 am
- yendii
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
It's time to refresh Apache as far as its current version is already 1.3.19 or more.
March 28, 2007 6:58 am
- cplusplus
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
I've got a trouble. PHP doesn't mention extensions!!! Whatever I do to describe the path - it doesn't work. Please, provide me some template of writing a string for extensions' modules paths setting in php.ini (P.S. Apache 1.3.19, php 4.0.5, windows 2000 Professional).
March 28, 2007 7:36 am
- steven9x
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Guys, just be attentive!
Someone has written that he cannot find php4apache.dll (no comments) – it is in the distributive of the latest PHP-versions.
include() and require(); work properly. But if the file is in another directory, you are to indicate "../dir/xxx.php", for instance.
But who could tell me why the new Apache 1.3.20 started displaying in error.log such things as:
File 'c:mysqlsharecharsets?.conf' not found (Errcode: 22)
Character set '#23' is not a compiled character set and is not specified in the 'c:mysqlsharecharsetsIndex' file
(I have both charsets directory and #23. Does it matter to Apache which coding MySQL uses and where it takes it from? It hasn’t been anything like that in 1.3.20)
P.S. Sorry, I’d like to say there hasn’t been anything like this in 1.3.14 (1.3.12).
Who has got troubles with SMTP? Renew your PHP. Mail sending hasn’t functioned in some of the 4th versions. It is the official developers’ information.
March 28, 2007 7:47 am
- R@mzess
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Thanks a lot! I've been searching all over the web but couldn't attach PHP to Apache. Maybe I'm not professional but I've managed it acoording to the instructions from this article!!!
March 28, 2007 8:10 am
- Conker
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
I’ve installed everything AS WRITTEN. But after that Apache ceased starting…
The reason is quite commonplace – windows- and Unix-paths have got different slashes.
It IS WRITTEN in the article:
LoadModule php4_module "f:/usr/local/php/php4apache.dll"
But it proved to be (by me under Win'98 SE)
LoadModule php4_module "D:Program Filesphp4php4apache.dll"
Maybe someone helps me…
P.S.
The rest of paths in httpd.conf (which Apache has entered itself) are written with Unix-slashes but everything functions perfectly 
March 28, 2007 8:33 am
- selmahyekishot
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Without any doubt, PHP as Apache-module is good news
But there are some problems as well
I’ve faced such one:
Configuration: WinNT+PHP (as module)
script:
header ("Content-type: image/jpeg");
$path="image.jpg";
$im=fopen("$path", "r");
fpassthru($im);Result expected: picture image.jpg should be displayed.
Problem: It doesn’t work!!!
Configuration: WinNT+PHP (as CGI)
script is the same.
Result expected: picture image.jpg should be displayed.
Problem: No problems! It works! It displays the picture!
What is the problem? Why doesn’t it work when PHP is linked up as module?
Many thanks in regard!!!
March 28, 2007 8:53 am
- mdwb
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
cplusplus, as to extensions and Win2k. The problem is that rearranging PHP as a module you are to write absolute paths in php.ini. I.e. if extension_dir has been, for instance, "ext" before, it should become "z:/usr/local/php/ext" now.
Don't be afraid of life, it is yours!
March 28, 2007 9:07 am
- biopd42
- Member


Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"
Dear author of the article... I've done everything that is written here. PHP works and seems not to display any errors but such a script doesn't work at all
<?php
function foo ($in) {
if ($in !="")
else return $out;}?>
<?php include (foo($QUERY_STRING)); ?>My provider's hosting works properly... Could you tell me what the matter is?
- Index
- » Discuss atricles
- » Discuss article: "Installation of PHP+Apache: CGI vs. module"


