boo_lolly Posted February 12, 2007 Share Posted February 12, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/38196-php-512-on-iis6-testphp-works-but-indexphp-prints-sytax/ Share on other sites More sharing options...
boo_lolly Posted February 12, 2007 Author Share Posted February 12, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/38196-php-512-on-iis6-testphp-works-but-indexphp-prints-sytax/#findComment-182927 Share on other sites More sharing options...
wildteen88 Posted February 12, 2007 Share Posted February 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/38196-php-512-on-iis6-testphp-works-but-indexphp-prints-sytax/#findComment-182947 Share on other sites More sharing options...
boo_lolly Posted February 12, 2007 Author Share Posted February 12, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/38196-php-512-on-iis6-testphp-works-but-indexphp-prints-sytax/#findComment-182974 Share on other sites More sharing options...
wildteen88 Posted February 12, 2007 Share Posted February 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/38196-php-512-on-iis6-testphp-works-but-indexphp-prints-sytax/#findComment-182984 Share on other sites More sharing options...
boo_lolly Posted February 12, 2007 Author Share Posted February 12, 2007 thanks wildteen, i'll look into that and get back to you. Quote Link to comment https://forums.phpfreaks.com/topic/38196-php-512-on-iis6-testphp-works-but-indexphp-prints-sytax/#findComment-182988 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.