Jump to content

Apache and PHP pain


glenelkins

Recommended Posts

Hi

I have installed apache 2.2x and it works fine. I unzipped the php installation and added the following to httpd.conf (Running Windows 2003)

[code]
LoadModule php4_module "c:\php\php4apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:\php\"
[/code]

my php is installed at c:\php with php.ini in this folder. I have added php to the windows path. Restarted the server and now apache wont start. I don't get this, all the files are there (including php4apache2.dll) but the above code taken out lets apache start...whats going on?? Iv even tried changing "\" to "/" and still no luck

I followed the instructions to the letter

Oh and I also added the doc_root to php.ini
Link to comment
Share on other sites

I don't think PHP4 is not compatible with Apache2.2.x. The Apache module that comes with PHP4 is only compatible with Apache2.0.x. This is because Apache2.2.x now handles modules differently compared to Apache2.0.x.

Try the latests CVS version of PHP4, or downgrade Apache to 2.0.x instead. Before you do that there may be a a third party Apache2.2.x module for PHP4 at apachelounge.com

EDIT: Yeah, there is a third party apache2.2.x available [url=http://www.apachelounge.com/download/mods/php4apache2.dll-php4.4.x.zip]here[/url]. Download the zip and extract the module overwriting the existing apache2.0.x module.
Link to comment
Share on other sites

[quote author=wamasterhunter link=topic=121968.msg508190#msg508190 date=1169161402]
I am having the same problem, except I have php5 and Apache 2.2.  Here is what I wrote: LoadModule php5_module c:/php5/php5apache2.dll
I even went and checked to see if that was the right address and it was.  But when I try to start apache it says I have an error and referrs me to this line. ???[/quote]
If you have PHP5.2 use php5apache2_2.dll instead this is the Apache2.2.x module. php5apache2.dll is the APache2.0.x module and php5apache.dll is the APache1.3.x module.
Link to comment
Share on other sites

Hi All
I am having the same problem with apache 2.2.4 and php5.2 I have added the following into the httpd.conf but still no joy.

LoadModule php5_module c:/Program Files/PHP5/php5apache2_2.dll
AddType application/x-httpd-php .php
Action Application/x-httpd-php "/PHP5/php.exe"

Can anybody help

Thanks

Lional
Link to comment
Share on other sites

remove the Action line:
Action Application/x-httpd-php "/PHP5/php.exe"

not needed. I believe that's only needed if you load PHP as cgi. But you are loading PHP as a module - recommended.

Also try not to install Apache or PHP in the the program files folder. I prefer to install Apache, PHP, MySQL and anything else relating to them in a folder called server in the root of my hard drive.
Link to comment
Share on other sites

[quote author=andrewholway link=topic=121968.msg513157#msg513157 date=1169731695]
I dont think apache 2.2 is that stable yet. Especially the windows version.[/quote]
WHat you talking about! It is stable. It just you need to use the correct module for the version of PHP you are using! A lot of people have got confused over this when upgrading to Apache2.2.x

This is what the different modules are for:
php5apache2_2.dll - for use with PHP5.2 (or above) and Apache2.2.x
php5apache2.dll - for use with PHP5.x and Apache2.0.x (NOT for Apache2.2.x!)
php5apache.dll - for use with PHP5 and Apache1.3.x
Link to comment
Share on other sites

If you are on Windows look for the Apache taskbar icon (lower right hand corner of screen). The icon has a green triangle inside a white circle which a pink/purple feather sticking out of it. Left click the icon select Apache2 from the list and select restart.

Or you can go the long route and go to Start > All Programs > Apache HTTP Server 2.x..x > Control Apache Server > Restart

If you are on *unix then you need to do it via command prompt. Look at the Apache documentation for the correct command for restart Apache server on *nix based systems. http://httpd.apache.org for documentation

Link to comment
Share on other sites

Did you add PHP as an Apache module? If yoiu didnt then APache is not configured correctly. Add this line to httpd.conf:
[code]LoadModule php5_module "C:/php/php5apache2.dll"[/code]
NOTE:change C:/php to the correct path to where PHP is installed. Also change php5apache2.dll to php5pache2_2.dll if you  have installed Apache2.2.x

after:
[code]#LoadModule ssl_module modules/mod_ssl.so[/code]
Save the httpd.conf and restart Apache server.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.