• You are not logged in. | Login

Post a reply

March 28, 2007 9:25 am

jjjlc1983
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

I've set up as modules but there is a problem - IE offers to download the script instead of starting it... Although AddType is done...


 

 

March 28, 2007 9:52 am

yendii
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

It's an interesting situation. By linking up external libraries (php_gd.dll) PHP installed as module supposes directory with Apache to be its root. Although path to PHP is indicated in httpd.conf I.e. by definition of variable extension_dir=./extensions/ library php_gd.dll is searched within non-existing directory.../apache/extension/ . Is it a bug or everything is OK?

Last edited by yendii (March 28, 2007 11:31 am)


 

 

March 28, 2007 11:53 am

mellis
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

By installation of PHP4 (which I did according to the instruction) I was displayed error No such file or directory. After some searches I found in one source that one of the compulsory steps should include switching session.save in your php.ini in order to make it indicate to the really existing temporary files’ directory (for instance, c:/windows/temp or c:/windows/tmp). After this operation it started working properly in the both variants (CGI-executable and as Apache-mode).


 

 

March 28, 2007 12:00 pm

franzkafka
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

Can you tell me what is it? "Internal Server Error" is displayed when starting CGI-script.

Last edited by franzkafka (March 28, 2007 12:01 pm)


 

 

March 28, 2007 12:37 pm

Mr.SMart
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

About half a year or more ago I installed PHP as module and didn't have any problems. I repeated all the steps today but I've managed nothing (I've dowloaded latest PHP & Apache 1.3 versions)
Module seems to link up but it doesn't do anything... After 30 minutes efforts it proved out that AddModule mod_php4.c should be added into http.conf
Something like this... sad


 

 

March 28, 2007 12:57 pm

IBdaMac
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

Sometimes optional string AddModule mod_php4.c helps (when attaching module).
Mine didn't work without it


 

 

March 28, 2007 1:16 pm

Keeper
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

Everything works!
Apache 1.3.22 + PHP 4.1.1 as module
Following must be written into httpd.conf:
into the section...
# Dynamic Shared Object (DSO) Support
LoadModule php4_module "d:/web/php/sapi/php4apache.dll"
AddModule mod_php4.c
into the section...
<IfModule mod_mime.c>
AddType application/x-httpd-php .php .phtml .php4
</IfModule>


 

 

March 28, 2007 1:31 pm

yendii
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

Is it possible to install PHP in such a way if I have second Apache version?


 

 

March 28, 2007 1:55 pm

shadow122
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

1) I have such a bug: PHP-scripts work in the site's root catalogue only. How can I strive with it?
2) How to make PHP-scripts send mails?


 

 

March 28, 2007 2:07 pm

yendii
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

1) It's a very interesting bug  smile
2) You need sendmail for windows.


 

 

March 28, 2007 2:42 pm

stp2233
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

Thanks for the article! Everything works. But IE 6.0 handles extensions .php, .php4...directly within folder Apache Group\Apache\htdocs\. If you place PHP-file in any other catalogue, browser simply outputs scripts.
At this in the browser's address string http://localhost/*.php is indicated. Any change of PHP-files placement outside of Apache Group\Apache\htdocs\*.php is going to cause error.


 

 

March 29, 2007 7:15 am

tucansam
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

It is possible to install PHP4(5) with Apache2 BUT then you need file php4apache2.dll(php5apache2.dll) instead of php4apache.dll(php5apache.dll).
It should be something like this within Apache2 configuration:
LoadModule php5_module "f:/php5/php5apache2.dll"
AddType application/x-httpd-php .php
If you need other formats, you may add them into the AddType string. For instance, mine looks like this:
AddType application/x-httpd-php .php .jpg

Why PHP-scripts aren’t started but try to be saved on the disk instead?
Simply there should be something like this in the beginning of the script:
header("Content-Type: text/html");
Or the same through meta:
&lt;meta http-equiv="Content-Type" content="text/html"&gt;

P.S.: PHP5RC3 and Apache2 get along together quite well under WinXP Pro


 

 

March 29, 2007 8:00 am

Stre@m
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

Just a small addition: to install PHP+Apache under Win with SSL-support you need module php4apache.dll compiled with /DEAPI option. But it is impossible to found in the net.
Notice that dll from the previous PHP-versions doesn’t suit.

We make following:
We get latest PHP-sources and launch them into PHP sub catalogue.
It is not necessarily to be Win – you may take php-4.3.11.tar.gz as well.
Next to it we launch sources for win apache in php_build\Apache and sources bindlib_w32 and win32build.
We get something like:
\work
\php
\php_build
\apache
\include
\lib
\libexec
\modules
\src
\include
\bindlib_w32
\win32build
Then we take project’s file, for instance
php\sapi\apache\php4apache.dsp or
php\sapi\apache\php4apache.vcproj
and start under visual studio.
We check compiler’s include settings and lib by linker and set up them correctly (if necessary).
Not all lib and include will be set up correctly in the source.
During compilation and link it becomes clear what hasn’t been set up yet – you need to add and install this.
Naturally release should be Release_TS as far as Debug_TS won’t be assembled because of absence of corresponding lib-files with debug-option.
We place latest lib from the PHP-installation into php\lib catalogue.
It should be noticed that Apache-sources (for example, 1.3.33) are sometimes wrong i.e. they don’t contain all the things that go with EAPI which include:
httpd.h
ap_alloc.h
buff.h
http_conf_globals.h
http_config.h
ap_mmn.h
ap_ctx.h
ap_hook.h
ap_mm.h
xmlparse.h.
In such a case you are to take them from the ‘right’ previous Apache-version – it doesn’t really matter for assembling as far as we are assembling PHP not Apache.
We insert /DEAPI (or /D "EAPI") into the additional compiler’s options.
Next Build and from the catalogue php/release_ts we obtain php4apache.dll needed.


 

 

March 29, 2007 8:17 am

n00bphp
Member
Ranks

Re: Discuss article: "Installation of PHP+Apache: CGI vs. module"

I've linked up Apache 2.50 and PHP5 as a module according to the beforegoing manual and it started working. It is SUPER! Thanks a lot!!!


 

 
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services