Jump to content

Recommended Posts

Hi!  I'm having a rather strange problem, and I'm not very familiar with IIS7 so I'm not sure how to fix it.

 

I've installed PHP as a FastCGI module on IIS 7, and everything seems to be fine except for the fact that it refuses to parse included files.

 

For example, this bit of code:

<?php
require_once('config.php');
phpinfo();
?>

prints config.php as text and does not parse it, however, the phpinfo() function does what it is supposed to and no errors are generated.

 

My include_path is set correctly, as it does indeed find the config.php file - it just won't parse it.

 

I've been wracking my brain on this all weekend, any insight would be greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/158591-php5-iis7-not-parsing-includes/
Share on other sites

Don't use <? (ever).

 

You got caught by the lazy-way short open tag. You won't always be on a server where you can change the setting that allows <? to work and from php.net -

; NOTE: Using short tags should be avoided when developing applications or

; libraries that are meant for redistribution, or deployment on PHP

; servers which are not under your control, because short tags may not

; be supported on the target server. For portable, redistributable code,

; be sure not to use short tags.

 

The short open tags were originally added as a way to save a little typing time, but as you just discovered they have wasted several orders of magnitude more time then they ever saved in typing time.

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.