logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP Installation on Apache...HELP
Author
dtikasingh



Joined: 19 Aug 2008
Posts: 6
Location: UK

PostPosted: Tue 19 Aug '08 21:21    Post subject: PHP Installation on Apache...HELP Reply with quote

OK...I installed MySQL, Apache and now PHP. When trying to integrate php to work with Apache I believe I have followed on the correct config steps outlined. When I create a test to show phpinfo() it does not work. My code is simply: <?php phpinfo(); ?>. This is created in a document using notepad++ and named phpinfo.php. When I place this is htdocs in the Apache directory and test in my browser, the page just outputs the code above. I have tried many attempts to change the config file but still get the same output. I am running VISTA, php 5, Apache 2.2. Can someone help?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 19 Aug '08 21:27    Post subject: Reply with quote

Is this line uncommented in httpd.conf?

AddType application/x-httpd-php .php

Have you been restarting Apache between config changes?
Back to top
dtikasingh



Joined: 19 Aug 2008
Posts: 6
Location: UK

PostPosted: Tue 19 Aug '08 22:51    Post subject: Reply with quote

The line is uncommented. In fact I also have added
Code:
AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps

and these as well:
Code:
AddHandler application/x-httpd-php .php
   AddHandler application/x-httpd-php-source .phps

not to mention:
Code:
PHPIniDir "C:/php/"
Loadfile "C:/php/php5ts.dll"
LoadModule php5_module "C:/php/php5apache2_2.dll"

I have been restarting apache in between changes. I just don't get it.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 20 Aug '08 0:41    Post subject: Reply with quote

I've never had much luck going that route .. works sometime .. sometimes not (my story with mod_fcgid as well).

I read somewhere once to

move copy of php.ini into c:\windows
move copy of php5ts.dll into c:\windows\system32

add just 2 lines to httpd.conf

LoadModule php5_module c:/php/php5apache2_2.dll
AddType application/x-httpd-php .php

This setup has never failed me. I only forget to overwrite php5ts.dll with the new one when upgrading PHP but I know my mistake immediately on Apache start which then reminds me to diff the two ini files to see if anything was added or removed.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 20 Aug '08 1:02    Post subject: Reply with quote

Please also view Basic PHP Troubleshooting
Back to top
dtikasingh



Joined: 19 Aug 2008
Posts: 6
Location: UK

PostPosted: Wed 20 Aug '08 11:06    Post subject: Reply with quote

I have tried all above and I still get just the code displayed on the screen.
I have also put these lines in the php.ini file:
Code:
doc_root = "C:\php\
and extension_dir = "C:\Program Files\Apache Software Foundation\Apache2.2\modules"


I have looked at the basic Troubleshooting help as well and seem to be doing all of that as well. Could I be overlooking something?
Back to top
dtikasingh



Joined: 19 Aug 2008
Posts: 6
Location: UK

PostPosted: Wed 20 Aug '08 13:07    Post subject: Reply with quote

OK... I was able to reinstall apache and do the config again.
When i test phpinfo () i get this error:
Quote:
Failed to Connect
The connection was refused when attempting to contact localhost.


Then I did some reading on Apache and tried to use
http://127.0.0.1:8080/phpinfo.php and it worked.
Why would it not work with localhost/phpinfo.php?
Does this mean it will work like this and I am in the free??
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 20 Aug '08 13:20    Post subject: Reply with quote

!! Port 8080!
Change in your httpd.conf Listen 8080 to Listen 80
Back to top
dtikasingh



Joined: 19 Aug 2008
Posts: 6
Location: UK

PostPosted: Wed 20 Aug '08 13:57    Post subject: Reply with quote

When I change it to 80...i get errors. why not 8080??
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 21 Aug '08 15:08    Post subject: Reply with quote

You can use port 8080, but than you have to use localhost:8080 in your url. Because the browser uses always port 80 for http:// connections.
Back to top
dtikasingh



Joined: 19 Aug 2008
Posts: 6
Location: UK

PostPosted: Thu 21 Aug '08 17:49    Post subject: Reply with quote

Thanks...This has been very informative. At least now everything works and I can start learning PHP! Very Happy
Back to top


Reply to topic   Topic: PHP Installation on Apache...HELP View previous topic :: View next topic
Post new topic   Forum Index -> Other Software