Jump to content

Apache showing PHP code instead of default browser.


lariat1997

Recommended Posts

Hey all,

 

I am new to the whole Apache/PHP thing.  I installed Apache 2.2.4 on Windows XP.  When I type in localhost on my browser, I see the php code and not the phpinfo webpage.  I need to load Apache and PHP5 seperately, but I did check it again using WAMP and it worked for WAMP.  But like I said, I need to be able to install them seperately.

 

Thanks in advance.

Link to comment
Share on other sites

Did you configure Apache to send php files to PHP preprocessor?

 

Adding the following three lines to the httpd.conf should do it:

LoadModule php5_module "C:/php/php5apache2.dll"
PHPIniDir "C:/WINDOWS"
AddType application/x-httpd-php .php

 

Note: if you use Apache2.2.x then change php5apache2.dll to php5apache2_2.dll

 

Also change C:/php to the correct path to PHPs folder.

 

save the httpd.conf and restart Apache.

 

Next step is to copy the following files from the php folder:

php5ts.dll

php.ini-recommended

 

to C:\WINDOWS (or C:\WINNT, depending on which exists).

 

rename php.ini-recommended to just php.ini

 

Restart Apache and test again.

 

This setup works for me everytime.

Link to comment
Share on other sites

Thank you, I will try this when I get home. 

 

One more question...I had to enter an email address in the config file, but what if I'm not on the internet?  I have a Flash/PHP5 book and was wondering if I can still teach myself without being on the internet with this particular machine.

 

Again, thanks for the reply.

Link to comment
Share on other sites

You don't have to be online to use Apache. Also the email address is used for nothing. You can use a duf one if you wanted, eg me@localhost

 

Apache only uses the email address to be shown in the servers signature when you view a directory index or when you get a 500 Internal Server Error.

 

The only time you need to to be connected to the internet is if you want access your web server on your computer over the internet. http://localhost/ is not connected through the internet.

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.