Partner and Community Forums
PHP Setting up problem with Windows 2008 Server
Last post Dec 27, 2008 08:11 PM by comet240
Dec 17, 2008 03:11 AM|comet240|LINK
hi i trying to get a guestbook for longest time to run on my website currently it will run certain guestbooks under php fine somewhat and others it will show the code example for now http://mike1.webhop.org/index.html and the password is "pass" i cant
seem to configure i guess php right even when i do the steps for windows 2008 server here is the phpinfo maybe someone can tell me where im wrong or need to configure
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact email@example.com.
Dec 17, 2008 11:08 AM|ksingla|LINK
PhpInfo shows thread safety is enabled. Seems like you are using thread safe version of PHP. Can you follow steps outlined in
this article? Article recommend you to run a non-thread safe PHP when used in fastcgi mode. You can first just try out non-thread safe version and see if it helps.
Dec 17, 2008 01:10 PM|comet240|LINK
ok ill try i not too smart at this as i just set it up i figured id just have to do the php install and set up in its steps to install and bang would work as i wanna make php guestbook work under my server side includes my .shtml files
ill read the article and let u know if it worked or not
Dec 17, 2008 02:03 PM|comet240|LINK
ah i still having problems what i did was installed a non thread version i got kinda confused with the article but what i did was installed the windows installer version of 5.2.8 non thread php and if i do the phpinfo one it says that the thread security
is now disabled but still get errors
http://mike1.webhop.org/easy_php_guestbook.html is the link for my guest book i wanna try but when u leave comment it just shows coding for the php
http://mike1.webhop.org/test.php is the file for ya to see my php settings maybe u can verify what i need to do
Dec 17, 2008 04:09 PM|brashquido|LINK
I doubt using the threaded version has anything to do with your issue here. The threaded version has been around for the most part of a decade and has been (and still is) used by many IIS users.
If some PHP pages are working and others are just spitting out a whole lot of code like garble, then I'd suggest that the issue is that some of your scripts are using the short PHP tag. That is they open with <? instead of <?php which on a default install
of PHP means they will not work on IIS. You can fix this by either ensuring all your PHP scripts are using the full <?php opening tag, or alternatively (and more simply) modify you php.ini so that the short_open_tag directive is set to on, save it, and recycle
your app pool.
If this doesn't work then it could also possibly have something to do with mimetype or scriptmaps, so let me know how you get on.
Dec 17, 2008 04:26 PM|comet240|LINK
ill try the first 2 u gave me options for considering i not very experienced with all this anymore my knowlege of like sql and stuff stopped in 2000 with nt5 and stuff in college so i not very advanced so some of your terminolgy over my head for the
moment but ill try looking in the ini file first and then or change the script
Dec 17, 2008 04:39 PM|comet240|LINK
ok neither worked if i just change the ini file to change the tag to ON still shows code if i change it back and alter the file from <? to <?php i get either a 500 internal error or unrecongized call
here is my link to me http://mike1.webhop.org/php_guestbook.php
and if you can look at the code here is where i got the free one from it was linked off the techrepublic website
cuz now i getting frustrated again doh
Dec 17, 2008 04:45 PM|brashquido|LINK
When you changed your php.ini file, did you check your phpinfo to ensure it was set to on? I'll see if I can download the scipt and take a look at it.
Dec 17, 2008 04:50 PM|brashquido|LINK
Just read on their site that the script DOES use short tags, so you will need to have the short_open_tags directive set to on for it to work. I even saw a guy (Dan Dan) in the test comment area of the site who said he got the script working on IIS after
enabling this option.
Dec 17, 2008 04:58 PM|comet240|LINK
ok i re changed to ON and restarted the webserver and checked the phpinfo still says off
and i dont know what application pool recyling means i figured u ment restart the webserver
Dec 17, 2008 04:59 PM|comet240|LINK
ya i noticed the help area the forum i gonna try it but could you tell me how to recyle then or what i need to do after i change the ini file to ON
Dec 17, 2008 05:05 PM|brashquido|LINK
Are you editing the correct php.ini file? According to you phpinfo the loaded php.ini file is C:\PHP\php.in. To recycle your application pool, open your IIS manager, expand the tree so you can see the item "application pools" and then select your application
pool and select "recycle" from the menu on the right hand side.
Dec 17, 2008 05:05 PM|comet240|LINK
ok i found the application pool and for recyling but still doesnt change the phpinfo
what application pool should i be using with my websites i have tried 3 the classic net one the default app one and just the defaults the computer makes for each website i make
Dec 17, 2008 05:15 PM|comet240|LINK
i dunno why it is still pointing to c:\php when the file it suposed to be using is the C:\phpnonthread as i do not know how change from threaded to non threaded
so where else is the computer forcing to keep reading at C:\php and stuff cuz now this ridiculus it doesnt change grrr
Dec 17, 2008 05:18 PM|brashquido|LINK
Which one is your site using? If you select your site and click on "basic settings" on the right you should be presented with a window which will tell you which app pool you are using...
Dec 17, 2008 05:22 PM|brashquido|LINK
The php.ini location can be defined using a number of methods. The most likely is the PHPRC environment variable. Does this variable name ring any bells?
Dec 17, 2008 05:25 PM|comet240|LINK
well what i did was started over
i made a new website thing called guestbook and application pool was called guestbook
and its using my default fasttocgi but its pointed to the C:\phpnonthread location but when i update my phpinfo it still points to c:\php even if i do a forced refresh
Dec 17, 2008 05:31 PM|comet240|LINK
PHPRC environment variable doesnt ring a bell basiclly all i know since i just playing around with win2008 server is
i install win2008 then i install the cgi php etc then i install the php software then i configure the handlers to have fasttocgi and thats all i know
Dec 17, 2008 05:37 PM|brashquido|LINK
The problems you are experiencing now is exactly the reason why PHP upgrade advice shouldn't be handed out on a whim as it is not a trivial task for an inexpeirneced user. There are many, many places you can get caught, and it is often quite hard to troubleshoot
without being infront of the console (or having an RDP session).
Dec 17, 2008 05:46 PM|comet240|LINK
so i pretty much screwed then right?
geesh didnt think some software was so complicated
ya i dont work with it everyday so i dont know i just play with stuff and see if it works for me or what not
Dec 17, 2008 05:47 PM|brashquido|LINK
Dec 17, 2008 05:51 PM|comet240|LINK
it returns as c:\PHPNonThread
figures my luck i install both php versions like the article talks about having more then 1 type of php installed and it goes to shit lol
so onto the config files i guess
Dec 17, 2008 06:03 PM|comet240|LINK
if its faster you can add me to msn firstname.lastname@example.org to help faster if possible
Dec 17, 2008 06:18 PM|brashquido|LINK
Unfortunately I have to go in a few minutes, but I do have one hand left to play which should trump everything with any luck. Follow these steps;
1) Open IIS manager and select your site.
2) Click on the "handler mappings" icon and double click on your PHP FastCGI mapping.
3) Change the "executable" path so it reads x:\path\to\php-cgi.exe|-c x:\path\to\php.ini\
In your case it will be something like "C:\PHPNonThread\php-cgi.exe|-c C:\PHPNonThread\"
This -c option should have a higher prioirity than anything else, so you should see your loaded php.ini path change once you've done this and saved. You'll also need to edit a few IIS specific settings in php.ini, but just do a search for IIS and you should
Dec 17, 2008 06:27 PM|comet240|LINK
ok seems to work now the code is gone and i can see cool thanks
is it ok to add u to msn if i have other questions? also will my other guest books i wanted to try work there were under classic asp and stuff
Dec 17, 2008 06:30 PM|comet240|LINK
spoke too soon still get a either 500 internal error or unrecongized call
thats under the php_guestbook.php file
figures was almost lol
Dec 17, 2008 06:33 PM|comet240|LINK
it works and doesnt work
works if i do it right on the server i get no 500 internal error but on my client computer here i get the error
so on the server i can post my comments on the guest book but from remote location i cant
is there a setting that says i cant do it outside of fhe server
Dec 17, 2008 07:27 PM|brashquido|LINK
Only have a few minutes. Just checked and it seems to be working up until the point of submission, which indicates a permission issue. Be sure that your IIS user account has NTFS modify permissions to the flatfile the guestbook needs to write to. Pretty
sure it will be in their install instructions...
Dec 18, 2008 06:02 PM|comet240|LINK
damn didnt know u replied last night but umm ill look what i have done was for all my websites the dctory that holds all the websites i have given full rights to all the users so then it inherits it also but ill check but i not sure what the iis user account
will have ntfs modify i dunno where id see that i have never seen that before just like full control special permision read write excute that kind of thing and whats a flatfile? i know the instructions talk about setting like 777 and stuff but isnt that
like unix/linux though from my days of doing redhat 5
Dec 18, 2008 06:57 PM|comet240|LINK
ok well i added all the IUSR and IISUSRS i found to the guestbook directory and gave them full control but nothing still the error i get but i dunno wht u mean by the nfts one and i dont know about flatfile either
Dec 27, 2008 08:11 PM|comet240|LINK
hi i havent still been able to get my guest book to work can you explai more about flat file rights i read about it that its a text file like for guest books and stuff but i have full read/write and special rights for the ISUSR and IISURS etc but still
problems is there something else to look for