Solved

Updating PHP in Windows Server 2012 r2

Posted on 2016-09-15
22
74 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
  • 8
  • 7
  • 6
  • +1
22 Comments
 
LVL 35

Expert Comment

by:Kimputer
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
 

Author Comment

by:Morgan Jones-King
Comment Utility
This was the dll that came with the newer version.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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 51

Expert Comment

by:Julian Hansen
Comment Utility
... 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
Comment Utility
The apache I'm running is:

httpd-2.4.17-x64-vc11
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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 51

Expert Comment

by:Julian Hansen
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 82

Expert Comment

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

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
Comment Utility
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
Comment Utility
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 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
Comment Utility
'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 51

Accepted Solution

by:
Julian Hansen earned 250 total points
Comment Utility
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
Comment Utility
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 51

Expert Comment

by:Julian Hansen
Comment Utility
You are welcome.
0
 

Author Comment

by:Morgan Jones-King
Comment Utility
Can you explain the difference between the x64 and x86 version?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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 51

Expert Comment

by:Julian Hansen
Comment Utility
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
Comment Utility
Thank you!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now