Upgrading PHP

I have Win7 ultimate 64=bit and I want to go from PHP 5.5.8(which is installed currently)to PHP 7.1

This is the page to download it-I assume.

But the question is which version to download…thread-safe or non-thread safe?

Download thread safe. Non-thread safe doesn’t have a file you need in order to get PHP working.

2 Likes

Recently, I needed PHP for command line only and both TS and NTS versions worked fine. Is there a difference between these versions for command line usage?

I don’t think there is a difference for command line. But there’s a file called php(X)apache2_4.dll which needs to be loaded into Apache for PHP to be called. Otherwise, PHP will fail. I believe this is equivalent to the fpm library on Linux. I also have never used the command line part of PHP yet other than using the .phar file to install Composer.

Obviously replace (X) for your version such as 5 if you’re using any PHP 5 versions and 7 if you’re using any PHP 7 versions.

1 Like

Ok I downloaded the ZIP…I assume later I unzip in a folder such as C/:php…
and then what is next…I think I must edit a file/path somewhere but I cannot remember exactly.

Are there no upgrade instructions with the download, or on the PHP site? I’d have hoped they would cover such a point.

You mainly edit the httpd.conf file in your Apache directory and the php.ini file. That’s it. If you were running 32xbit, you’d need to copy and paste 3 files (I don’t recall, but they are in the PHP directory) and you have to paste that to be Apache dirctory in order for cURL to work. If you just run default settings, in your error logs, you will get an error saying that php_curl.dll could not be found even though you have that file and the path is correct. That’s if you were to use cURL.


EDIT: Here is a video I had made a while back for upgrading versions on Windows. Don’t use my preference, use yours instead because I know yours is setup differently.

1 Like

I have made all the changes necessary in php.ini but I cannot restart apache.
Maybe changes in httpd.conf will fix that but I do not know what changes to make to this file…the video does not make a reference to it.

That’s because the video already runs on PHP 7. The only thing was that it was an upgrade from an RC to a public release. So there is no need for the video to edit httpd.conf. But you on the other hand, have to change the line where you load the module for PHP. Since you are upgrading from PHP 5 to PHP 7, you have to replace the (X) from my earlier post where php(X)apache2_4.dll is the module. If you are using a 3rd party software like WAMP or XAMPP, I would assume the same can be done, but I obviously don’t use those because my setup makes it easier to upgrade as you can see from the 3 minute video.

Also, if you can’t find where to restart your Apache, the video shows you exactly where to restart it. It has to be within your Apache directory and then within the bin directory, there should be a file called Apache Monitor. Open it if it isn’t opened already. Then there’s a “restart” button so click on it and it’ll ask you for permissions. Then after that, wait about 5 seconds and Apache should restart. If the Apache icon in your icon tray has a red icon instead of the green ok icon, that means you screwed up some where in your httpd.conf file. You will have to fix it in order for Apache to start up again.

towards the end of httpd.conf I have placed this line
LoadModule php7_module "C:/php7.1/php7apache2_4.dll"

apache still cannot be restarted…
as you can see from above php7.1 is the dir where php files are located.

Any ideas?

take a look the error I get https://hastebin.com/tufekikawi.vbs

Just looking at the last word of that error, are you sure you’re running 64xbit? Make sure to download both Apache and PHP for the right architecture. I am at work so I can’t debug your error. I’ll have to figure out why you have that error when I get home.

And make sure you have Apache from https://www.apachelounge.com/ not from the official distribution.

My machine without doubt is 64bit but there is something else that puzzles me.This is the PHP version I download.

But when it gets downloaded the filename contains the word win32 in it:php-7.1.7-Win32-VC14-x64.

Why this?

I don’t think the issue is with the distribution. I feel like something is missing. I’ve done it once using the 64xbit in the past, but it has been a super long time that I forgot how to do it for 64xbit. I’ve always used the 32xbit version since I always run 32xbit. Sorry for the late reply as well. I didn’t feel good when I got home so I slept early. I will try my best later on to fix your problem.

In the mean time, move the LoadModule line to just right after the ending of all the LoadModule lines instead of having it at the way bottom of your httpd.conf file. I’m not sure if this affects it, but it doesn’t hurt to try.

Also, have you installed all 3 C++ redistributions on the left side bar of the download page?

The sidebar bit me once. I subconsciously disregarded it as a type of navigation area or other content not as important as to what I perceived to be the “main” content. When in fact, it was very important. So much so that if I had designed the page I would have made it more prominent in the “main” content area

http://windows.php.net/download#php-7.1

1 Like

moving LoadModule did not do a thing.
I am in the process now of installing Visual C++ 2017…maybe this will fix the problem(although for now I have problem installing it).After I install it successfully I will tell you if that solves the apache problem.

Just to clear things up since I have a hunch. When you were running PHP 5.5 were you using a 3rd party like WAMP or XAMPP? Or did you have a setup similar to what you are attempting now? The reason why I am asking is because the setupts for this and for 3rd parties such as WAMP or XAMPP are entirely different and you have to install it very differently.

The first thing is to know what you have used previously to understand what the problem is. If you used a setup similar to the one you are attempting to do on PHP 7, then the setup should of worked since all you would of had to do was edit the part where it said php(x)apache2_4.dll, modify your php.ini to your liking and then restart the Apache Monitor. That’s it. But if you were to install it entirely from scratch since you used something like WAMP or XAMPP and you wanted to try this setup as a new option, then you are missing a whole lot more than just moving around the LoadModule lines.


First things first, paste your entire httpd.conf and php.ini file here.

First of all…
No I did not use XAMP or WAMP neither I do…or whatever similar software.
Let’s recap.
I downloaded php 7.1VC15 and realized it could not work with apache 2.4.
At that point I noticed(and from a web search) that both PHP and apache in order to work together must be based on the same Visual C++ Redistributable.

And now I am in the process of installing Visual C++ Redistributable 2017.Hopefully this will solve the problem.

Unfortunately I cannot either install Visual C++ Redistributable.
image
In other words it is a mess.
currently there is no point showing you httpd.conf and php.ini.

I must solve the issue with visual c++ redistributable 2017

Ok, how were you able to run PHP 5.5 previously before this mess? You need to answer this question before we can figure out what the problem is. Also, the 2017 redistribution that the PHP team has linked seems to be recently new. The 2008 redistribution link was actually there before it. Try installing the 2008, 2012, and 2015 redistributions. I haven’t tried the new 2017 one yet, but I assume there are bugs in it since it is roughly new.

Also, your httpd.conf and php.ini files are still relevant to this case. Please post them so that when you fix the issue, we can figure out what the issue is with Apache promptly. If it helps, reboot your PC and then try installing the 2017 or 2008 redistributions.

https://www.microsoft.com/en-us/download/details.aspx?id=15336

Οk here we go.
Before I had not problems as I said…I used PHP 5.5.8 and Apache Win32-2.4.2 VC10.

Here are the versions now that I cannot make it work:php-7.1.7-Win32-VC14-x64 and httpd-2.4.27-win64-VC14.

Here is the problem that appears if I go to start Apache monitor(it never starts of course).

Here is httpd.conf(apache configuration file):file

Here is php.ini:file

In this image snapshot you will see that I have downloaded all VC distributables except 2017. After a search I made it is not necessary and as you said it might contain bugs as it is new:image

What might be causing all this is corrupt dll files in the C++ distributables