Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: PHP doesn't get processed |
|
Author |
|
anero
Joined: 19 Oct 2006 Posts: 2
|
Posted: Fri 20 Oct '06 1:24 Post subject: PHP doesn't get processed |
|
|
Hi!
I'm having troubles on getting to work php...
The versions I'm running are:
* php 5.1.6
* apache 2.0.59
* Windows XP
I've done everything it's said over several tutorials to configure both apps but I keep getting the php as text instead of being processed.
On httpd.conf I have:
LoadModule php5_module "c:/php-5.1.6/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php-source .phps
PHPIniDir "C:/php-5.1.6/"
And on the php.ini:
include_path = ".;c:\php\includes"
doc_root = c:\apache-2.0\htdocs\
extension_dir = c:\php-5.1.6\ext\
On the PATH (system) environment variable I've the php directory.
Apache is serving html files fine...
The only thing could be different is I'd previously installed apache 2.2 but I finally decided to install 2.0 (I'm going to use subversion 1.4 and the version combination has several issues to be resolved...)
On 2.2 I'd got to work php with the special module php5apache2.dll, but after going to 2.0 I removed all directories and reinstalled php.
Of course I've double checked the path but I think I'm missing something (I've spend far too much time trying to get this thing working!)
Any ideas?
Thx a lot!
d |
|
Back to top |
|
Brian
Joined: 21 Oct 2005 Posts: 209 Location: Puyallup, WA USA
|
Posted: Fri 20 Oct '06 5:59 Post subject: |
|
|
What happens when you call up a PHP file? Does it dump the PHP code as text?
Do you have your basedir set correctly?
Here is an example of how I set up PHP on one of my testing servers:
Code: | LoadFile "c:/apache2/PHP_SAPI/php5ts.dll"
LoadModule php5_module c:/apache2/PHP_SAPI/php5apache2.dll
PHPinidir c:/apache2/PHP_SAPI
<Directory c:/www/SAPI>
AddHandler application/x-httpd-php .php
</Directory> |
So everything in the c:/www/SAPI directory that ends with .php gets processed through the PHP engine. I noticed you did not have the LoadFile... portion of the configuration.
Make sure that the paths are absolutely correct. I noticed you named your PHP install directory a sort of long name, so just thought you'd benefit from double checking. |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Fri 20 Oct '06 6:45 Post subject: |
|
|
The LoadFile directive is not necessary to enable PHP on Apache.
The statement that "it's not working" is vague at best. Brain's question about what is happening IS very pertinent though. So what is the behaviour that is being exhibited? Does Apache start? If so, what happens when you request a PHP page?
First things first, we need to figure out what is and is not occurring.
Also, doc_root in PHP.INI is not necessary since you are running PHP as an Apache module (vs. CGI) or you are not running PHP in safe mode (gachkk).
..
. |
|
Back to top |
|
anero
Joined: 19 Oct 2006 Posts: 2
|
Posted: Sat 21 Oct '06 19:57 Post subject: Problem solved |
|
|
Thank you both, I finally get it working!
When I added the AddHandler application/x-httpd-php .php as Brian said, apache begun to process the php pages (before it only showed them as text, that's what I meant by "it's not working" )
On apache 2.2 I didn't have this line and still it worked just fine. Moreover, I didn't read about this on any of the help from apache or php, I thought that configuring the mime was enough...
Anyway, thank you 2 for your help!
d |
|
Back to top |
|
|
|
|
|
|