Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-30-2008, 08:21 PM   PM User | #1
rhyno
New Coder

 
Join Date: Sep 2007
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
rhyno is an unknown quantity at this point
How to upgrade PHP 5 on Windows?

Amazing that I haven't been able to find anything Googling this... seems like a common operation...

What is the recommended procedure for upgrading PHP 5 on a Windows (Server 2003 / IIS 6) box?

I imagine simply: stopping IIS services, moving/renaming the current /PHP directory, creating a new one with the latest version of PHP, and restarting IIS -- this should do the trick.

But I'm a stickler for best practices, and avoiding any unintentional pitfalls.
Going from PHP 5.1.2 to 5.2.6.

Advice?


Thanks,
--RHYNO
rhyno is offline   Reply With Quote
Old 10-31-2008, 12:45 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,752
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Thats how I'd do it. Its been awhile since I configured IIS and don't recall how you change PHP's directory, but I'd just add a new directory and change the pointer to it.
One thing I'd suggest is separating you're ext directory so that different PHP versions can share the same extensions.
For you're minor version change, honestly I'd just overwrite the original. On the other hand, I've worked with PHP a long time, so if something goes wrong I can easily fix it. Easier said than done if you're not familiar with PHP configurations. So instead, I'd just make a /php directory (where / can really be anywhere of you're choosing) and then add php-5.1.6, php-5.2.4, etc as subdirectories below it. Makes it easy to find and switch in case you want temporary upgrades for testing.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 10-31-2008, 12:49 AM   PM User | #3
hinch
Regular Coder

 
hinch's Avatar
 
Join Date: Sep 2005
Location: UK
Posts: 921
Thanks: 25
Thanked 79 Times in 79 Posts
hinch is on a distinguished road
if i remember correctly its not even the entire php directory you need to upgrade its just the php.dll (forget its exact name) since for most windows systems php is compiled to a dll which is then registered and called by IIS as far as I remember it doesn't use the php.exe at all when doing web based requests.
(though I could be wrong its been a long time since I've used php and IIS)
__________________
A programmer is just a tool which converts caffeine into code

My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
My hobby: http://www.angel-computers.co.uk
My life: http://www.furious-angels.com
hinch is offline   Reply With Quote
Old 10-31-2008, 01:03 AM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,752
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
No I think you're right.
I don't really pay too much attention to this either, but I seem to recall upgrading a minor version by swapping one of my PHP4 dlls. I don't recall for certain, but I think it was php4apache2.dll. This is used on a Windows XP machine configured with an Apache client.
If this is the case, its just a matter of identifying which one is used for IIS (I don't know for certain).
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 10-31-2008, 02:14 AM   PM User | #5
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,744
Thanks: 2
Thanked 256 Times in 248 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
All the main and extension .dll files must be the same version to avoid runtime errors when they don't match up because they will have been complied with different C header files.

php5ts.dll is the main php language engine. Most of other .dll files in the main folder are simply interfaces to the main engine for different servers - cgi, sapi, apache...

Either replace all the files or none of them.
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is online now   Reply With Quote
Old 12-17-2008, 12:43 PM   PM User | #6
wcoleman
New to the CF scene

 
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
wcoleman is an unknown quantity at this point
Hey,

It would be worth checking out FastCGI for IIS 6 while you're upgrading to 5.2.6. You can find details about using FastCGI on IIS 6 to host PHP applications here. Worth noting that the 5.2.6 has a stack of improvements so that PHP runs a lot better on Windows than previously.

You may want to also look at upgrading to WS2008/IIS 7 as the new functionality in combination with the improved PHP support makes it a lot easier to host PHP applications. IIS.net has a whole section on this.
wcoleman is offline   Reply With Quote
Old 08-04-2011, 05:14 PM   PM User | #7
willow315
New to the CF scene

 
Join Date: Aug 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
willow315 is an unknown quantity at this point
Upgrading to PHP 5.3.2 on Windows 2003 with IIS6

I am upgrading from PHP 5.2.5 to PHP 5.3.2. on a Windows 2003 server, running IIS6. I would also like best practices and procedures for upgrading, as opposed to doing a fresh install. I have downloaded and extracted the new version of PHP, and placed the folder in the root of the server. I've backed up the old php.ini and PHP525 folder.

I can proceed as if I'm installing PHP for the first time...configuring IIS and the php.ini etc, but would like to follow best practices from someone who has done it successfully before me. Also what do I do with the old PHP folder? How can it be removed successfully? When adding PHP to the path, ie Environment Variables in MyComputer/Advanced...I know I'd add the current path to my PHP532 folder. Do I delete the other?

I know I have to configure IIS in Web service extensions. I already have .PHP entered as an extension, but I'm sure I must have to update the path the to new PHP5ISAPI.DLL, if that's what it's called in the new version, no?

Then in IIS, the Websites directory...In a new installation, I'm directed to add an Application Extension in the Home Directory...and again put the path to the PHP5ISAPI.DLL. Am I adding a new extension...probably just overwriting what's there, now?

And what about the php.ini? What, if anything should be configured differently between 5.2.5 and 5.3.2? The old tutorial I found doesn't even mention configuring php.ini. And I certainly did when installing 5.2.5. I do have it living in the Windows directory. Any thoughts on that?

And in reference to using MySQL, this post in an old installation tutorial refers to libmysql.dll....IN the PHP5.3.2 folder there isn't even any file like this at all?

"If you are going to use MySQL you will need to make sure to uncomment the line “extension=php_mysql.dll” in php.ini and copy C:\PHP\LIBMYSQL.DLL to C:\WINDOWS\SYSTEM32 (Simply setting the PATH won’t work as this is apparently hard coded in PHP5). If you don’t follow these steps you will get an error message similar to this: “Call to undefined function mysql_connect”. "

So, some updated best practices would be totally appreciated. I am sort of stuck with the IIS6 and Windows 2003, but need to upgrade my PHP to this newer version.

Thanks for any assistance anyone might be able to give me! WCW
willow315 is offline   Reply With Quote
Old 08-04-2011, 05:53 PM   PM User | #8
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,667
Thanks: 46
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Personally I'd just download and install the uniformwebserver. Works straight out of the box if your on an NT based system.
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 08-04-2011, 06:40 PM   PM User | #9
willow315
New to the CF scene

 
Join Date: Aug 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
willow315 is an unknown quantity at this point
Well, that's not really the question, is it? I'm using IIS, and that's the situation I'm asking about. And I'm not using any PHP code, so I don't really understand your comment about bracketing PHP code.

I hope that someone else is willing to address my questions. Thanks. WCW
willow315 is offline   Reply With Quote
Old 08-04-2011, 06:44 PM   PM User | #10
willow315
New to the CF scene

 
Join Date: Aug 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
willow315 is an unknown quantity at this point
My apologies for bumping this old thread, but I really need some info on this topic. Should I start another thread? But then this one's already bumped. Sorry.
willow315 is offline   Reply With Quote
Old 08-04-2011, 07:09 PM   PM User | #11
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,667
Thanks: 46
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
The problem you face is that few people use IIS and php. Sure there are some people but you'll find the large majority of IIS systems are probably VPS's/ dedicated servers which already have it pre-setup by the data centre.

Thats why I made my recommendation. Sorry you felt that having the latest version running within minutes was a better idea.
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 08-04-2011, 07:55 PM   PM User | #12
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,604
Thanks: 2
Thanked 399 Times in 392 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
There is quite a bit of information in the PHP manual about migrating between the various versions.
Inigoesdr is offline   Reply With Quote
Old 08-05-2011, 08:14 AM   PM User | #13
janice93
New to the CF scene

 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
janice93 is an unknown quantity at this point
a friend showed me to just download a AMP stack? well anyhow im using XAMP now and i believe it is 5
janice93 is offline   Reply With Quote
Reply

Bookmarks

Tags
iis, php, upgrade, windows

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:08 AM.


Advertisement
Log in to turn off these ads.