Jump to content

Recommended Posts

we are reconfiguring the directory structure for a client of ours. unfortunately they are running on IIS. i have had a lot of trouble configuring everything correctly but after i followed this guide for the most part, and now i am much closer to completing this install than ever before.

 

test.php works fine:

<html>
<head>
	<title>PHP Test</title>
</head>
<body>
	<!-- testing sessions -->
	<?php session_start(); ?>

	<!-- testing browscap.ini -->
	<?php
		echo $_SERVER['HTTP_USER_AGENT'] . "<br/><br/>";
		$browser = get_browser(null, true);
		print_r($browser);
		echo "<br/><br/>";
	?>

	<!-- a general PHP test -->
	<?php phpinfo(); ?>
</body>
</html>

 

but when i run my index.php, it just prints like half the php syntax onto the browser. what could be wrong here?

it has become apparent to me that the issue may be involved with the PHP headers that are used in my client's website. just about all of the pages use short headers (<? | ?>). where would i find out what file or configuration setting is responsible for interpereting the PHP headers?

They are not PHP Headers but PHP tags. The setting you are after is called short_open_tag

 

It is recommend that you code your scripts with the full open tags (<?php ?>) and do not use the short tags (<? ?> or <?= ?>) in scripts. This will allow your scripts to be compatible on all servers.

thanks for the reply. i agree that long tags are much better than short tags. however, i did not create this website, we are simply reconfiguring their directory structure, and i have developed a test environment here. right now, i am trying to configure PHP to work on IIS correctly, so that we can begin changing the directory structure.

 

i cannot change the header tags, as there are probably over 200 files i would need to edit. it would be much better, if there were a file i could change that would accept PHP short tags. i looked in my php.ini file and short_open_tag was set to 'Off'. i turned it 'On' and restarted IIS... and i still have the same problem =\. i'm not sure why. it may have something to do with mysql, tho... here is some of the syntax that is printed...

SELECT NICKNAME from members WHERE ID='137'PHP Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user'@'localhost' (using password: YES) in D:\Htdocs\rockdaleisd.net\azureadmin\lib\db.php on line 11 PHP Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in D:\Htdocs\rockdaleisd.net\azureadmin\lib\db.php on line 13 PHP Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in D:\Htdocs\rockdaleisd.net\azureadmin\lib\db.php on line 17 PHP Warning: fopen(./debmes.txt) [function.fopen]: ...........

 

what do you think?

From looking at what you posted. PHP is running the script fine. However its your mysql configuration that is at fault when you connect. Make sure the username and password credentials you use on the mysql_connect function are correct.

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.