Jump to content

Apache not showing PHP


zeromyst

Recommended Posts

First off, I am fairly new at PHP and Apache but not new to programming in general. I learn through experimenting with code, but can't get Apache to work correctly with PHP in the first place, and thus, I can't do either of the above  :(

 

Im running Windows XP, Apache 2.2.4 , and PHP 5.2.3.

 

Currently, Apache's http://localhost is currently working, it shows all the files in my htdocs folder and I can view everything else the way it should be...

 

However, neither Mozilla nor EI will show the PHP test files with code such as <? phpinfo(); ?> and instead, only displays a blank screen. When I view the source however, it shows the exact code that its supposed to, but still doesn't work properly. Just a little frusterated since my background is basic HTML and am not used to 2 programs needing to be tied together like this. Any response at all will be appreciated, and sorry if this is a normal question.

Link to comment
Share on other sites

Always use the full PHP tag syntax (<?php ?>) and not the short hand version (<? ?>). Try:

<?php
phpinfo()
?>

 

By default PHP has a setting called short_open_tag disabled and thu <? ?> tags do not work. IMO it is best to use the full tag syntax.

 

Also it is important that you restart Apache when you have edited Apache's or even PHP's configuration files (http.conf or php.ini) in order for any changes you have made to take effect.

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.