Solved

Updating PHP in Windows Server 2012 r2

Posted on 2016-09-15
22
472 Views
Last Modified: 2016-09-21
Hello,

I currently run PHP 5.5.19 on a windows server 2012 r2 environment with Apache 2.4. I'm trying to update my php version to php 5.6.25. I've replaced the binaries (after creating a backup folder), formatted the .ini, and looked at the httpd.conf. My command line recognizes that php 5.6.25 is the version running, but my apache server won't start.

What am I doing incorrectly?

Thanks in advance!
0
Comment
Question by:Morgan Jones-King
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
  • 6
  • +1
22 Comments
 
LVL 36

Expert Comment

by:Kimputer
ID: 41800057
Apache keeps a good error log when it doesn't want to start. Please look into these log files, and if you don't see any, enable it first, then start the service again.
Also enable error logging in the php.ini file, it might provide the correct info to solve this also
0
 

Author Comment

by:Morgan Jones-King
ID: 41800242
Ok, this was in my error log.

[Thu Sep 15 10:48:36.650163 2016] [mpm_winnt:notice] [pid 1908:tid 564] AH00424: Parent: Received restart signal -- Restarting the server.
httpd.exe: Syntax error on line 179 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/php5apache2_4.dll into server: %1 is not a valid Win32 application.

I thought I had downloaded the correct version of PHP. My system type reads: 64-bit operating system, X64-based processor. So I downloaded the php-5.6.25-Win32-VC11-x64 zip file.

Additionally, when I pull up the Apache desktop service monitor the bottom still reads: "Apache/2.4.10 (Win32) PHP/5.5.19"
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41800332
The new version of PHP should have come with a new version of that DLL.  You can't intermix versions of the files in PHP even though they have the same name.  Make sure the 'httpd.conf' is pointing to the correct file also.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:Morgan Jones-King
ID: 41800365
This was the dll that came with the newer version.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41800376
I just noticed "Apache/2.4.10 (Win32) PHP/5.5.19" .  You probably should have downloaded the 32-bit TS version of PHP.  Many if not most installs of PHP and Apache on Windows are still 32-bit.  There are versions of WAMP that are 64-bit but the last time I checked, XAMPP is only 32-bit.
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41800403
... and you are definitely running the 64bit version of Apache - because if you are not that is your problem.

The log file is saying that the dll you are pointing to is not a valid Windows binary - and according to your download file name that is the 64bit version of PHP - so I am guessing that Apache is 32 bit - can you confirm?
0
 

Author Comment

by:Morgan Jones-King
ID: 41800446
The apache I'm running is:

httpd-2.4.17-x64-vc11
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41800532
Then where did you get "Apache/2.4.10 (Win32) PHP/5.5.19" which is a different version?  Also note that the compiler (vc11) must be the same version for both Apache and PHP so that the system and DLL calls work properly.  And of course, you must have the runtime library for that compiler and it must be either 32-bit or 64-bit to match Apache and PHP.
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41801104
Also note that the compiler (vc11) must be the same version for both Apache and PHP so that the system and DLL calls work properly
This is not strictly true. It is not necessary for the compiler versions to match - but it is necessary to have the VC runtimes for both installed - but that should not be an issue because we already know from the opening post that both are running on the system - Apache was there before and PHP runs from the command line which is only possible if the run times were already installed.
For giggles I just built a 2012 VM, loaded the same strain of Apache (httpd-2.4.23-x64-vc11) and the same PHP php-5.6.26-Win32-VC11-x64 - after configuring httpd.conf and php.ini it pretty much worked out of the box. So there is no problem with those two versions working together.
Can you posted your httpd.conf file.
1
 

Author Comment

by:Morgan Jones-King
ID: 41801541
Hi, first of all, it turns out I misspoke on my Apache version. I'm looking aback at my error log to see what the version actually was. It reads: Apache/2.4.10 (Win32), VC11 Server built. My httpd.conf is attached.
httpd.txt
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41801847
On the Windows Download page for PHP http://windows.php.net/download#php-7.0 , there is info in the left column about the compilers and the libraries that are required along with the Recommended version of Apache.  I believe that you can only have the 32-bit or the 64-bit version of the run-time libraries but not Both.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41801856
Note that the Apache Lounge http://www.apachelounge.com/download/ versions are the ones used to build the PHP and other interfaces.
0
 
LVL 58

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41802255
I believe that you can only have the 32-bit or the 64-bit version of the run-time libraries but not Both.
You need the run times to match the compiled application. 32 bit needs 32 bit run times and 64 bit needs 64 bit.
EDIT - to clarify - Windows (64) will (and must) support both 32 and 64 bit - 32 bit installs to  System32 64bit to SysWow64

Apache/2.4.10 (Win32) - looks like the 32 bit version of Apache.

Can you run the following from the bin folder
httpd -v
If it says Win32 then you need the 32 bit version of PHP.
0
 

Author Comment

by:Morgan Jones-King
ID: 41802300
Hi,

My server version is Apache/2.4.10 (Win32). But I'm positive I downloaded and installed the 32 version of PHP: php-5.6.25-Win32-VC11-X64

Is there somewhere to download the .dll specifically in 32 bit?
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 41802370
'php-5.6.25-Win32-VC11-X64' is 64-bit as shown by the 'x64' at the end.  And the 32-bit version of the DLL will Not work with the 64-bit version of PHP.  You need the VC11 x86 Thread Safe version on http://windows.php.net/download#php-7.0.
0
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 41802404
Is there somewhere to download the .dll specifically in 32 bit?
You want the whole package. This link will take you to the right section
http://windows.php.net/download#php-5.6-ts-VC11-x86

The thread safe ZIP is the one to go for.
0
 

Author Comment

by:Morgan Jones-King
ID: 41808798
Hi all,

Julian, you answered my question! I'd been downloading the php 5.6 - VC11 - X64 instead of x86. Using the x86 did the trick! Everything is working now. Thanks all!
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41808858
You are welcome.
0
 

Author Comment

by:Morgan Jones-King
ID: 41808862
Can you explain the difference between the x64 and x86 version?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41808868
Program interfaces for x64 and x86 versions are different.  Specifically, any binary data will be 64-bit or 32-bit.  If you were to pass the wrong size data to a program or DLL, it would not be interpreted correctly.
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41808986
From a functionality perspective they are identical.

The x86 version is compiled to run on 32bit Operating systems
The x64 version is compiled to run on 64bit Operating systems.

However, the x86 will run on both - i.e. you can run the x86 version on a 64bit OS - but not vice versa - X64 won't run on 32bit.

The main difference between the 32 and 64bit is the size of the word - which translates into how much memory you can address. In the case of PHP this is unlikely to make a difference either way.
0
 

Author Comment

by:Morgan Jones-King
ID: 41808996
Thank you!
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OfficeMate Freezes on login or does not load after login credentials are input.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question