|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to set up a web server on my windows xp machine. I chose to run Apache (2, latest version), PHP 5 and MySQL. At first I tried it with IIS but that didn't work out quite as I anticipated (didn't show ASP pages, so I figured PHP scripts wouldn't run with it either). So what I did, I uninstalled IIS and downloaded and installed Apache 2 and configured it the default way. Edited the httpd.conf file using the recommended settings etc. After this I used the PHP 5 zip distribution file and unpacked it to c:\php. I edited the php.ini file using the way that php.net describes it to do. Now, when I'm starting the apache server and attempt to load a simple php script test file, it just displays the source code of the script, instead of actually executing it. I have tried everything to overcome this problem (changed short_open_tag to on in php.ini, added the recommended lines to the apache httpd.conf file etc) but nothing works and it's driving me crazy.
Anybody here able to help me with that? It would be much appreciated. Rudy ![]() |
|
#2
|
||||
|
||||
|
"didn't show ASP pages, so I figured PHP scripts wouldn't run with it either" - Although this isn't necessarily true, I think Apache is a better option for PHP.
I would like to clarify first, as I don't see that you've stated it... You have your PHP file in Apache's home directory and are trying to access it with your browser pointed at http://localhost/somefile.php correct? Have you added the lines to the apache conf file for AddType and LoadModule?
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
|||
|
|||
|
I have configured c:\web as my apache webdir and consequently have added the two lines you mentioned (loadmodule and addtype) to my conf file. Still showing php source code though (and it's only a simple time/date display script too)
|
|
#4
|
|||
|
|||
|
Haha, I think I'll just try EasyPHP, that is supposed to have everything covered. Still stumps me though why the stupid thing shows source code instead of the execution of a simple script php.
![]() |
|
#5
|
||||
|
||||
|
Wait, don't giveup so soon.
If you didn't have the Apache configurations setup, you might have missed some other stuff. Apache doesn't just know how to read a PHP file... it must be configured to send the script to the PHP interpreter first... I found a simple blog post which covers how to set up Apache and PHP on Windows. There's also a couple articles here on Devarticles. |
|
#6
|
|||
|
|||
|
from the sounds of your respones you've done nothing to make sure php works with either server.
with apache in your httpd.conf file you'll have to add these 3 lines. LoadModule php5_module c:\php5\php5apache2.dll AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps of course, you would have to point to your own php folder. with IIS the process is the same, except that you only have to point the isapi file. using your iis manager point to the isapi file like this, c:\php5\php5isapi.dll and that's it. also make sure your php5ts.dll is in the system32 folder.
__________________
Apache Expert |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > PHP pages won't load, show source code (Apache 2/PHP 5) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|