Page 1 of 2

Apache Wont Display PHP

Posted: Sat Aug 05, 2006 8:32 pm
by LiveFree
Hello All,

Well after figuring out my WiFi card issue, I am turning my FC5 Distro into the ultimate Dev Shed!

But I have configured Apache to work with PHP (so I hoped)

But when I go to the index of a php-project, nothing shows. It doesnt ask me to download the file or anything, nothing shows.

Thanks,
Rick

Posted: Sun Aug 06, 2006 3:35 am
by volka
If you open the source code view of your browser, do you see the php script there?
If so your webserver is not yet configured to let php handle php scripts.

Posted: Sun Aug 06, 2006 4:09 am
by Cladinshadows
I have the same problem as the above guy and my browser displays the code when I view the source.

php version:
5.1.4
Apache version:
2.0.59

Thanks for any help!

Posted: Sun Aug 06, 2006 4:19 am
by volka
Did you add the appropriate LoadModule and AddType directives in http.conf as explained in install.txt?

Posted: Sun Aug 06, 2006 4:44 am
by Cladinshadows
Yeah I did.

Here are the lines I added just encase they're wrong:

First one:
LoadModule php5_module c:/php/php5apache2.dll

Second one:
AddType application/x-httpd-php .php

Posted: Sun Aug 06, 2006 7:15 am
by Chris Corbyn
did you restart the service?

Posted: Sun Aug 06, 2006 10:27 am
by LiveFree
No Source Code is displayed

Posted: Sun Aug 06, 2006 3:40 pm
by Chris Corbyn
LiveFree wrote:No Source Code is displayed
What code are yu running? Check your apache error logs.

Posted: Sun Aug 06, 2006 4:59 pm
by Cladinshadows
Yes, I did restart the service.

My friend sent me over a html file and it opened that correctly, but the phpinfo page I made to test it loads blank.

My source:
<?php
phpinfo();
?>

Posted: Sun Aug 06, 2006 6:48 pm
by RobertGonzalez
LiveFree wrote:No Source Code is displayed
Make a phpinfo() page and see if it loads. A blank page is usually a sign that there is an error in the script and that display_errors is off.

Code for your phpinfo.php page.

Code: Select all

<?php
phpinfo();
?>

Posted: Sun Aug 06, 2006 6:48 pm
by RobertGonzalez
Cladinshadows wrote:Yes, I did restart the service.

My friend sent me over a html file and it opened that correctly, but the phpinfo page I made to test it loads blank.

My source:
<?php
phpinfo();
?>
Which file did you add those directives to? Where in the file did you add them?

Posted: Sun Aug 06, 2006 8:08 pm
by LiveFree
Yep I can see the phpinfo page

(Although I find it interesting you had to tell me how to do a phpinfo() page)

I cant believe display_errors is Off! I could have sworn I set that to on in the .ini

Posted: Sun Aug 06, 2006 8:39 pm
by RobertGonzalez
LiveFree wrote:Yep I can see the phpinfo page

(Although I find it interesting you had to tell me how to do a phpinfo() page)
Sorry, habit.

Posted: Mon Aug 07, 2006 1:28 am
by Cladinshadows
Everah wrote:
Cladinshadows wrote:Yes, I did restart the service.

My friend sent me over a html file and it opened that correctly, but the phpinfo page I made to test it loads blank.

My source:
<?php
phpinfo();
?>
Which file did you add those directives to? Where in the file did you add them?
I made a unicode text file and wrote it in, then I saved it as a .php. I saved the file as index.php and put it in the htdocs folder in my Apache folder.

As an added note, I also attempted to open the file via command prompt:

cd php
C:\php: C:\apache2\apache2\htdocs\index.php

It then asked me what program I wished to use to open the file...I'm not sure what I'm suppose to select here (if anything), but I chose Internet explorer and the file won't even open.

My php.ini is in my windows folder as well.

Posted: Mon Aug 07, 2006 1:32 am
by RobertGonzalez
Sorry, should have clarified. I meant these...

Code: Select all

LoadModule php5_module c:/php/php5apache2.dll

AddType application/x-httpd-php .php
Where did you put these statements? Also, you restarted the server, correct? And lastly, you said that the page display is blank, but the PHP code shows in 'View Source'? Please confirm.