Jump to content

Help with httpd.conf and PHP


Cgull

Recommended Posts

Hello,

 

I know nothing about PHP or Apache and that's why I started a tutorial on the internet.

 

It says there that I need to put these lines in the httpd.conf file:

 

LoadModule php4_module php/sapi/php4apache2.dll

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

 

But I don't know where exactly in the file should I put them.

 

I installed PHP 4.4.6 and Apache 2.2.4.

 

Tried to find the answer here, read lots of messages, but gave up trying to find the answer to this specific question :'(

 

Can anyone help?

 

Thanks,

Cgull

 

 

Link to comment
Share on other sites

You can place those lines anywhere within the httpd.conf. However I prefer to place each line with similar configuration lines. For example I add LoadModule php4_module php/sapi/php4apache2.dll at the end of the LoadModules list and then place the two AddType lines in the AddType list. However the order doesn't really matter.

 

Please note that Apache2.2.x is not compatible with PHP4.4.x. As I have seen many people have problems with PHP4 and Apache2.2.x. Either downgrade Apache to Apache2.0.x or upgrade to PHP5.2x.

 

Also make the following that is highlighted in bold a full path:

LoadModule php4_module php/sapi/php4apache2.dll

 

So if you installed PHP in C:/php change the above highlighted text to this:

LoadModule php4_module "C:/php/sapi/php4apache2.dll"

 

It is easier to work with full paths than relative paths.

 

NOTE: If you upgrade PHP to version 5.2.x then make sure you use the php5apache2_2.dll module instead of php5apache2.dll - php5apache2.dll module is not compatible with your current version of Apache (version 2.2.x) it is only compatible with version 2.0.x

Link to comment
Share on other sites

Thanks.

 

I installed now Apache 2.0.59, added these lines:

 

LoadModule php4_module C:/Program Files/Apache Group/Apache2/php/sapi/php4apache2.dll

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

 

And now I get this error:

 

Syntax error on line 173 of C:/Program Files/Apache Group/Apache2/conf/httpd.conf:

 

LoadModule takes two arguments, a module name and the name of a shared object file to load it from

Link to comment
Share on other sites

Oh My GOD !!! Will it ever work???  :(

 

Now I get this:

 

(OS 10048)Only one usage of each socket address (protocol/network address/port)

is normally permitted.  : make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

Unable to open logs

Note the errors or messages above, and press the <ESC> key to exit.  11...

 

 

Thanks for all the help

Link to comment
Share on other sites

You have something else running on port 80. Either disable/uninstall whatever is running on port 80 or change the port Apache listens too.

 

To change the port Apache listens to, read on...

 

Open up httpd.conf and search for the following line:

Listen 80

 

Change 80 to 8080, so the line is now like this:

Listen 8080

 

Save the httpd.conf and restart Apache. Do you get the same error message? If you don't open up a web browser and go to http://localhost:8080/

 

You should now see a welcome to Apache message.

 

Apache and PHP should now be setup.

 

Note you must have ":8080" (minus the quotes) after localhost due to Apache now listening to port 8080 instead of 80.

Link to comment
Share on other sites

Hey,

 

Tried that too, didn't work.

 

So, I tried to restore my system to the point before I installed Apache and that broke Windows totally.

 

Need to reinstall Windows now  :'(

 

If my computer will work again, I will try the whole installation story again.

 

Thanks for all the help.

 

Cgull

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.