I would like to know how you upgrade PHP in Xampp for Windows? I tried to download the latest PHP version from the main PHP site but when I check (phpinfo) I still get that the previous version is still in use.
我想知道如何在Xampp中为Windows升级PHP ?我试图从主要PHP站点下载最新的PHP版本,但是当我检查(phpinfo)时,我仍然可以看到以前的版本仍然在使用。
15 个解决方案
#1
107
Take a backup of your htdocs and data folder (subfolder of MySQL folder), reinstall upgraded version and replace those folders.
备份您的htdocs和data文件夹(MySQL文件夹的子文件夹),重新安装升级版本并替换那些文件夹。
Note: In case you have changed config files like PHP (php.ini), Apache (httpd.conf) or any other, please take back up of those files as well and replace them with newly installed version.
注意:如果您已经更改了PHP (PHP .ini)、Apache (httpd.conf)或任何其他的配置文件,请重新备份这些文件,并将它们替换为新安装的版本。
#2
52
You can go through the following link as it helped me, should work for you as well. http://hype-free.blogspot.com/2007/07/updating-php-in-xampp-for-windows.html
你可以通过下面的链接来帮助我,也应该为你工作。http://hype-free.blogspot.com/2007/07/updating-php-in-xampp-for-windows.html
Realizing that my answer helped couple of users, here is the edit from original link:
意识到我的回答帮助了一些用户,这里是原始链接的编辑:
Edit:
编辑:
First of all Always backup your data.
- Download the latest binary version of PHP (make sure to get the .zip package not the installer)
- 下载最新的二进制版本的PHP(确保得到.zip包而不是安装程序)
- De-archive it to a directory
- 将其解压到一个目录中。
- Overwrite the contents of directory in the php subfolder of your XAMPP installation directory.
- 覆盖XAMPP安装目录的php子文件夹中的目录内容。
- Overwrite the contents of the directory apache\bin with the newer versions.
- 用更新的版本覆盖目录apache\bin的内容。
- Now the trick: take the files which have a '_2' in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the '_2' part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.
- 现在的技巧是:获取文件名中有“_2”的文件(例如php5apache2_2)。dll或php5apache2 _2_ filter.dll),将它们复制到apache\bin子目录中,并删除“_2”部分,覆盖现有文件。这是必要的,因为XAMPP使用Apache版本2.2,而带有两个前缀的文件是为Apache 2.0构建的,所以您必须为新版本(它有一个不同的插件接口)构建文件,并将它们重命名为filenames XAMPP期望的文件。
NOTE: there are two directories to be updated with new version of files, namely php
sub-directory and apache/bin
sub-directory, inside XAMPP installation.
注意:在XAMPP安装中,有两个目录需要更新,新版本的文件,即php子目录和apache/bin子目录。
#3
32
Simplest method to upgrade PHP
in XAMPP
:
XAMPP中PHP升级最简单的方法:
- Download latest portable version of
XAMPP
. - 下载最新版本的XAMPP。
- Extract the archive(not where
XAMPP
already installed). - 提取归档文件(不是XAMPP已经安装的地方)。
- Copy the
PHP
folder from the extracted archive. - 从提取的存档中复制PHP文件夹。
- Keep back up of
PHP
folder which is in installedXAMPP
directory. You can backup it like changing thePHP
folder name toPHP-old
or likePHP-version-number
- 保存在已安装的XAMPP目录中的PHP文件夹。您可以备份它,比如将PHP文件夹名称更改为PHP-old或类似PHP-version-number。
- Paste the
PHP
folder which you copied from the extracted archive. - 粘贴您从提取的存档中复制的PHP文件夹。
- Replace the
php.ini
file with your backup folderphp.ini
file in case you have changed the default settings earlier. - 替代php。用你的备份文件夹php文件。如果您之前更改了默认设置,那么ini文件。
- That's all, start/restart the
server
. - 就这样,启动/重新启动服务器。
#4
11
I needed to update my php from 5.3.8 to 5.3.29. (both Thread Safe) on Windows
我需要把我的php从5.3.8更新到5.3.29。(两个线程安全)在Windows上。
Steps I did:
我做的步骤:
- Back-up my initial php folder, under xampp.
- 备份我的初始php文件夹,在xampp下。
- Downloaded zip from here http://windows.php.net/download/#php-5.3-ts-VC9-x86
- 从这里下载zip, http://windows.php.net/download/#php-5.3-ts-VC9-x86。
- Unpack that zip into xampp folder.
- 解压缩到xampp文件夹。
- Copied php.ini file from old php folder into new one.
- 复制php。将旧php文件夹中的ini文件放入新的文件夹中。
- Copied a couple of folders that I didn't have in the new php folder, from old one. For example: extras, which contained browscap.ini file (this one is needed)
- 复制了一些我在新php文件夹中没有的文件夹,从旧文件夹中。例如:额外的,包含了browscap。ini文件(需要这个文件)
- Copied needed extensions, from old php ext folder into new php ext folder. I copied them manually, by checking list of extensions from php.ini file.
- 复制所需的扩展,从旧的php ext文件夹到新的php ext文件夹。我手动复制了它们,通过检查php扩展列表。ini文件。
- Copied also these files: php5apache2_2.dll, php5ts.dll
- 复制这些文件:php5apache2_2。dll,php5ts.dll
Hope that I covered everything.
希望我能涵盖一切。
Most probably these steps will not work if you change major versions of php, e.g. 5.3.x to 5.4.x, but for minor versions, it should work.
如果您更改了php的主要版本(例如5.3),那么这些步骤很可能不会起作用。5.4 x。但对于较小的版本,它应该起作用。
Also, a good way to see what's wrong... start command line and try to start httpd.exe, under xampp/apache/bin from there, it will list errors found.
还有,看看哪里出了问题……启动命令行并尝试启动httpd。exe,在xampp/apache/bin下,会出现错误。
#5
9
I think you need to actually download and install XAMPP with the desired PHP version. I dont think you can just upgrade the components of XAMPP individually unless there is a facility provided for this within XAMPP itself.
我认为您需要实际下载并安装XAMPP,并使用所需的PHP版本。我认为,除非XAMPP内部有一个设施,否则你不能单独升级XAMPP的组件。
#6
9
download your desired version of php binary from http://windows.php.net/download/ website. download Thread Safe binary zip version. Unzip the downloaded version of the PHP in a separate folder. Please make sure that your new php folder name is not "PHP". May be you can use filder name as the version name. For example for php 5.4 you can use php54.
从http://windows.php.net/download/网站下载你想要的php二进制版本。下载线程安全的二进制zip版本。将下载的PHP版本解压到单独的文件夹中。请确保您的新php文件夹名称不是“php”。可以使用filder名称作为版本名称。例如,对于php 5.4,您可以使用php54。
Copy the new php folder into your xampp folder. Now go to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. Change the following variables:
将新的php文件夹复制到xampp文件夹中。现在转到yourxampp/apache/conf/额外文件夹。httpd-xampp打开文件。从文件夹中额外获得conf。改变以下变量:
Variable PHPINIDir to be / Varaible LoadModule to be //php5apache2_2.dl
变量PHPINIDir为// Varaible LoadModule为//php5apache2_2.dl。
Save the file httpd-xampp.conf. Restart your XAMPP apache server. If your server get restarted successfully then your server php version is upgraded.
保存文件httpd-xampp.conf。重新启动XAMPP apache服务器。如果您的服务器成功重启,那么您的服务器php版本将被升级。
#7
6
I don't have enough reputation to comment yet, but, to add to ssharma's answer:
我还没有足够的名声来评论,但是,我想补充一下ssharma的回答:
After you copy your htdocs folder to a safe place, just export your databases from PHPmyadmin. Simply go to each of your databases and click on the export tab at the top. Export them as sql (or whatever, really - just remember what you chose). Upgrade your XAMPP installation. Now, in the new version of XAMPP, create the databases that you want to re-insert. Example: you have a database named 'test' that you exported from your old installation, name the new, empty database the same thing. Now, go into 'test' and hit the import button along the top (right next to the export button). Click on choose file, find the sql file that you exported earlier (should be 'test.sql') and import. Your tables and data will be in place.
将htdocs文件夹复制到安全位置后,只需从PHPmyadmin导出数据库。只需访问每个数据库并单击顶部的export选项卡。将它们导出为sql(或者其他的,真的——只要记住你选择了什么)。升级你的XAMPP安装。现在,在XAMPP的新版本中,创建您想要重新插入的数据库。示例:您有一个名为“test”的数据库,它从旧的安装中导出,将新的、空的数据库命名为相同的东西。现在,进入“测试”并按下顶部的导入按钮(就在出口按钮旁边)。单击choose file,找到您先前导出的sql文件(应该是test.sql)和导入。您的表和数据将就位。
NOTE: There's an option to export the entire collection of databases (it names the file 127.0.0.1.sql). But, I've never had much luck getting it to import correctly. Do each of your databases separately to ensure it works. I made this post kind of long-winded, but that's because I like to write for the people that don't know exactly what they're doing yet (I, myself, was there not too long ago (all of us were at some point)).
注意:有一个选项可以导出整个数据库集合(它命名文件127.0.0.1.sql)。但是,我从来没有很幸运地让它正确地导入。分别对每个数据库进行操作,以确保其正常工作。我把这篇文章写得有点冗长,但那是因为我喜欢为那些不知道自己在做什么的人写文章(我自己,不久前还在那里(我们都在某个时间点))。
Shorthand version of my answer:
1) Export your databases individually
2) Import into your new installation of XAMPP
我的回答的简写版本:1)将你的数据库单独导出到XAMPP的新安装中。
#8
5
There are newer beta versions of Xampp that come with newer PHP upgrades.
新版本的Xampp有较新的PHP升级版本。
you should check at http://www.apachefriends.org
你应该查看http://www.apachefriends.org。
#9
4
- Go to
phpinfo()
, press ctrl+f, and typethread
to check the value. - 转到phpinfo(),按下ctrl+f,并键入线程以检查该值。
- If it is enabled download the non thread safe version, otherwise download the thread safe version from here (zip).
- 如果启用了非线程安全版本,则从这里下载线程安全版本(zip)。
- Extract it, and rename the folder to
php
. - 提取它,并将文件夹重命名为php。
- Go to your xampp folder rename the default
php
folder to something else. - 转到xampp文件夹,将默认的php文件夹重命名为其他内容。
- Copy the extracted (renamed
php
) folder in xampp directory. - 在xampp目录中复制提取的(重命名的php)文件夹。
- Copy the
php.ini
file from default/oldphp
folder (That you renamed) and paste it into the newphp
folder. - 复制到php。ini文件从默认/旧php文件夹(您重新命名)并粘贴到新的php文件夹中。
- Restart xampp server and you're good to go.
- 重新启动xampp服务器,您很好。
#10
3
http://www.apachefriends.org/en/xampp-windows.html
http://www.apachefriends.org/en/xampp-windows.html
In this site you can get
在这个网站你可以得到。
XAMPP Add-Ons
XAMPP附加组件
by using this add on you can upgrade the latest versions.
通过使用这个插件,您可以升级最新版本。
#11
3
I have upgraded to php7.2 from php5.6
我已经从php5.6升级到php7.2。
Steps which I followed.
我跟着步骤。
- Download PHP binary from here. I have downloaded VC15 x86 Thread Safe Zip file.
- 从这里下载PHP二进制文件。我已经下载了VC15 x86线程安全Zip文件。
- Created a backup of xampp/php folder.
- 创建了xampp/php文件夹的备份。
- Extract all the contents of zip file to xampp/php folder.
- 将zip文件的所有内容提取到xampp/php文件夹。
- Copied php.ini (as I have modified it before and I want my configuration back, if you were using default one then skip this step.)
- 复制php。ini(我之前已经修改过了,我想要我的配置回来,如果你使用默认设置,那么跳过这个步骤)。
- Edit below file
- 编辑以下文件
C:\xampp\apache\conf\extra\http-xampp.conf
C:\ xampp \ apache \ conf \额外\ http-xampp.conf
- Replace
- 取代
LoadFile "C:/xampp/php/php5ts.dll"
LoadFile“C:/ xampp / php / php5ts.dll”
LoadFile "C:/xampp/php/libpq.dll"
LoadFile“C:/ xampp / php / libpq.dll”
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
LoadModule php5_module“C:/ xampp / php / php5apache2_4.dll”
to
来
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile“C:/ xampp / php / php7ts.dll”
LoadFile "C:/xampp/php/libpq.dll"
LoadFile“C:/ xampp / php / libpq.dll”
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
LoadModule php7_module“C:/ xampp / php / php7apache2_4.dll”
-
Replace php5_module to php7_module everywhere in this file.
在这个文件中,将php5_module替换为php7_module。
-
Restart Apache
重新启动Apache
#12
3
1) Backup your htdocs folder
2) export your databases (follow this tutorial)
3) uninstall xampp
4) install the new version of xampp
5) replace the htdocs folder that you have backed up
6) Import your databases you had exported before
1)备份你的htdocs文件夹2)导出你的数据库(跟随本教程)3)卸载xampp 4)安装新版本的xampp 5)替换你已经备份的htdocs文件夹,导入你之前导出的数据库。
Note: In case you have changed config files like PHP (php.ini), Apache (httpd.conf) or any other, please take back up of those files as well and replace them with newly installed version.
注意:如果您已经更改了PHP (PHP .ini)、Apache (httpd.conf)或任何其他的配置文件,请重新备份这些文件,并将它们替换为新安装的版本。
#13
2
1) Download new php from official site (better some zip). Old php
directory rename to php_old
and create again php
directory and put there unzipped files.
1)从官方网站下载新php(最好是zip)。旧的php目录将重命名为php_old,并重新创建php目录并将其解压缩文件。
In php.ini
connect needed modules if you used something that was turned off by default (like memcached etc.), but don't forget to add corresponding .dll
files.
在php中。如果您使用的是默认关闭的东西(比如memcached等),那么ini连接需要的模块,但是不要忘记添加相应的.dll文件。
2) In my case I had to update Apache. So repeat the same steps: download new package, rename directories, create new apache
directory and put there new files.
在我的例子中,我必须更新Apache。所以重复相同的步骤:下载新的包,重命名目录,创建新的apache目录,并放入新的文件。
Now you can try to restart apache running apache_start.bat
from xampp
folder (better run this bat, than restart apache service from Windows services window, cause in this case in console you'll see all errors if there will be some, including lines in config where you'll have problem). If you updated Apache and run this file, in the list of services you'll see Apache2.2, but in description you can get another version (in my case that was Apache/2.4.7).
现在您可以尝试重新启动apache运行apache_start。来自xampp文件夹的bat(最好运行这个bat,而不是从Windows服务窗口重启apache服务,因为在这种情况下,如果有一些错误,包括配置中的行,您将会看到所有的错误)。如果您更新了Apache并运行这个文件,在服务列表中您将看到Apache2.2,但是在描述中您可以得到另一个版本(在我的例子中是Apache/2.4.7)。
In case of Apache update you can get some problems, so mind:
在Apache更新的情况下,您可能会遇到一些问题,请注意:
-
after you replace the whole directory, you may need to configure you
apache/conf/httpd.conf
file (copy virtual hosts from old config, set up DocumentRoots, permissions for directories, all paths, extend list of index files (by default apache has onlyindex.html
so other index files will be just ignored and Apache will just list the site root directory in browser), configure you logs etc.)在您替换整个目录之后,您可能需要配置您的apache/conf/httpd。conf文件(从旧配置中复制虚拟主机,设置文档根,目录的权限,所有路径,扩展索引文件列表(默认情况下,apache只有索引)。html这样其他索引文件就会被忽略,Apache只会在浏览器中列出站点根目录,然后配置日志等等。
-
connect modules you need (if you used something that was not turned on by default like mod_rewrite etc.)
连接您需要的模块(如果您使用的是默认情况下没有打开的模块,比如mod_rewrite等)。
#14
2
I just upgrade my old XAMPP portable with PHP 5.3.X(Include Mercury & FileZilla & Tomcat) to XAMPP portable with PHP 5.6.X ( Include previous versions ) ...
My way:
我只是用PHP 5.3升级了我的旧XAMPP。X(包括Mercury & FileZilla & Tomcat)到XAMPP可携带PHP 5.6。X(包括以前的版本)…我的方法:
- First download last xampp portable(my using version: xampp-portable-win32-5.6.14-3-VC11Direct Download Link) Last XAMPP
- 第一个下载xampp可移植(我的使用版本:xampp-portable-win32-5.6.14-3 vc11direct下载链接)最后一个xampp。
- Extract new download file to drive d , because new version dont have mercury,filezilla,tomcat in it , then i copy these packages from my old version to new one
- 提取新的下载文件以驱动d,因为新版本中没有mercury、filezilla、tomcat,然后我将这些包从旧版本复制到新版本。
- Now on old xampp first copy all htdocs files to new xampp htdocs
- 现在,在老xampp上,首先将所有htdocs文件复制到新的xampp htdocs。
- Now on old xampp backup all of database in 5 two 10 separated sql files
- 现在,在旧的xampp备份所有数据库的5个2个10个分离的sql文件。
- Now on new xampp going and change some settings like
max_upload_size
and etc on php.ini and also in/apache/conf/extra/httpd-xampp.conf
- 现在,在新的xampp上,修改一些诸如max_upload_size之类的设置。ini,还有/apache/conf/extra/httpd-xampp.conf。
- Now delete ( make a rar archive and delete ) it , and copy new xampp from drive
D
to driveC
- 现在删除(做一个rar归档和删除),并从驱动器D复制新的xampp来驱动C。
- Now start new xampp , going to phpmyadmin , create a user and password that i use in previous xampp and add all privileges that user.
- 现在启动新的xampp,进入phpmyadmin,创建一个用户和密码,我在以前的xampp中使用,并添加用户的所有权限。
- Now going to import tab on phpmyadmin and separately import sql files.
- 现在要导入phpmyadmin并分别导入sql文件。
- Now i test xampp with all new features in drive C
- 现在我测试xampp的所有新特性在驱动C。
NOTE
On Export database tab on phpmyadmin, select UTF-8 Character and check Disable foreign key checks
checkbox
and on import tab uncheck Enable foreign key checks
.
在phpmyadmin上的导出数据库选项卡上,选择UTF-8字符,并检查禁用外键检查复选框,并在导入选项卡上取消启用外键检查。
#15
0
For Upgradation php in Xampp you can follow this steps, Else you can skip these 4 steps and direct install MAMP (for windows as well) from site and here is the direct download link
对于Xampp中的Upgradation php,您可以按照以下步骤操作,否则您可以跳过这4个步骤,直接在站点上安装MAMP(用于windows),这里是直接下载链接。
Step 1: Make backups Before starting, make sure to backup any settings, custom modules and most importantly the htdocs directory, which contains your scripts and page resources. This directory is normally located atC:\xampp\htdocs\
步骤1:在开始前进行备份,确保备份任何设置、定制模块,最重要的是包含您的脚本和页面资源的htdocs目录。该目录通常位于atC:\xampp\htdocs\。
Step 2: Preparation
步骤2:准备
Download PHP 5.3.0rc2. I use the VC6 build in order to minimise any potential compatibility issues. It is also recommended that you download the latest Windows version of XAMPP. While this is an upgrade guide that shouldwork with previous versions of XAMPP, it is recommended that a fresh copy of the core files is used. Stop any instances of the Apache service that might be running.
下载PHP 5.3.0rc2。我使用VC6构建来最小化任何潜在的兼容性问题。还建议您下载XAMPP的最新Windows版本。虽然这是与XAMPP的早期版本一起工作的升级指南,但建议使用核心文件的新副本。停止可能正在运行的Apache服务的任何实例。
Step 3: The upgrade This guide will assume your XAMPP directory is C:\xampp\
步骤3:本指南的升级将假定您的XAMPP目录是C:\ XAMPP \。
Extract the XAMPP archive to a directory of your choosing, I would recommend using the default C:\xampp\ Extract the contents of the PHP archive to C:\xampp\php\, overwriting the contents of this directory with the new files. Open the file C:\xampp\apache\conf\extra\httpd-xampp.conf and ensure the following lines are present in this order:
将XAMPP归档文件解压缩到您选择的目录中,我建议使用缺省的C:\ XAMPP \将PHP存档的内容提取到C:\ XAMPP \ PHP \,用新文件覆盖该目录的内容。打开文件C:\ xampp \ apache \ conf \额外\ httpd-xampp。conf并确保以下几行代码如下:
LoadFile "/xampp/php/php5ts.dll"
LoadModule php5_module "/xampp/apache/bin/php5apache2_2.dll"
Replace C:\xampp\php\php.ini with C:\xampp\php\php.ini-dist
Uncomment the lines:
;extension=php_mbstring.dll
;extension=php_pdo_sqlite.dll
Replace the line
magic_quotes_gpc = On
with
magic_quotes_gpc = Off
Copy all files in the C:\xampp\php\ to C:\xampp\apache\bin\ (do not copy the subdirectories or their contents).
将所有的文件复制到C:\xampp\php\到C:\xampp\apache\bin\(不要复制子目录或它们的内容)。
After following the above steps, restart your Apache service (this can be done using C:\xampp\xampp-control.exe or manually through the control panel/command prompt). Your PHPinfo should indicate that the upgrade has been successful. I will update this post if I discover any problems from using this method, or a cleaner (automated) means of performing the upgrade.
在执行上述步骤之后,重新启动您的Apache服务(可以使用C:\xampp\ xamppcontrol来完成)。exe或手动通过控制面板/命令提示符。您的PHPinfo应该表明升级已经成功。如果发现使用此方法的任何问题,或者使用更干净的(自动化的)进行升级的方法,我将更新这篇文章。
#1
107
Take a backup of your htdocs and data folder (subfolder of MySQL folder), reinstall upgraded version and replace those folders.
备份您的htdocs和data文件夹(MySQL文件夹的子文件夹),重新安装升级版本并替换那些文件夹。
Note: In case you have changed config files like PHP (php.ini), Apache (httpd.conf) or any other, please take back up of those files as well and replace them with newly installed version.
注意:如果您已经更改了PHP (PHP .ini)、Apache (httpd.conf)或任何其他的配置文件,请重新备份这些文件,并将它们替换为新安装的版本。
#2
52
You can go through the following link as it helped me, should work for you as well. http://hype-free.blogspot.com/2007/07/updating-php-in-xampp-for-windows.html
你可以通过下面的链接来帮助我,也应该为你工作。http://hype-free.blogspot.com/2007/07/updating-php-in-xampp-for-windows.html
Realizing that my answer helped couple of users, here is the edit from original link:
意识到我的回答帮助了一些用户,这里是原始链接的编辑:
Edit:
编辑:
First of all Always backup your data.
- Download the latest binary version of PHP (make sure to get the .zip package not the installer)
- 下载最新的二进制版本的PHP(确保得到.zip包而不是安装程序)
- De-archive it to a directory
- 将其解压到一个目录中。
- Overwrite the contents of directory in the php subfolder of your XAMPP installation directory.
- 覆盖XAMPP安装目录的php子文件夹中的目录内容。
- Overwrite the contents of the directory apache\bin with the newer versions.
- 用更新的版本覆盖目录apache\bin的内容。
- Now the trick: take the files which have a '_2' in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the '_2' part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.
- 现在的技巧是:获取文件名中有“_2”的文件(例如php5apache2_2)。dll或php5apache2 _2_ filter.dll),将它们复制到apache\bin子目录中,并删除“_2”部分,覆盖现有文件。这是必要的,因为XAMPP使用Apache版本2.2,而带有两个前缀的文件是为Apache 2.0构建的,所以您必须为新版本(它有一个不同的插件接口)构建文件,并将它们重命名为filenames XAMPP期望的文件。
NOTE: there are two directories to be updated with new version of files, namely php
sub-directory and apache/bin
sub-directory, inside XAMPP installation.
注意:在XAMPP安装中,有两个目录需要更新,新版本的文件,即php子目录和apache/bin子目录。
#3
32
Simplest method to upgrade PHP
in XAMPP
:
XAMPP中PHP升级最简单的方法:
- Download latest portable version of
XAMPP
. - 下载最新版本的XAMPP。
- Extract the archive(not where
XAMPP
already installed). - 提取归档文件(不是XAMPP已经安装的地方)。
- Copy the
PHP
folder from the extracted archive. - 从提取的存档中复制PHP文件夹。
- Keep back up of
PHP
folder which is in installedXAMPP
directory. You can backup it like changing thePHP
folder name toPHP-old
or likePHP-version-number
- 保存在已安装的XAMPP目录中的PHP文件夹。您可以备份它,比如将PHP文件夹名称更改为PHP-old或类似PHP-version-number。
- Paste the
PHP
folder which you copied from the extracted archive. - 粘贴您从提取的存档中复制的PHP文件夹。
- Replace the
php.ini
file with your backup folderphp.ini
file in case you have changed the default settings earlier. - 替代php。用你的备份文件夹php文件。如果您之前更改了默认设置,那么ini文件。
- That's all, start/restart the
server
. - 就这样,启动/重新启动服务器。
#4
11
I needed to update my php from 5.3.8 to 5.3.29. (both Thread Safe) on Windows
我需要把我的php从5.3.8更新到5.3.29。(两个线程安全)在Windows上。
Steps I did:
我做的步骤:
- Back-up my initial php folder, under xampp.
- 备份我的初始php文件夹,在xampp下。
- Downloaded zip from here http://windows.php.net/download/#php-5.3-ts-VC9-x86
- 从这里下载zip, http://windows.php.net/download/#php-5.3-ts-VC9-x86。
- Unpack that zip into xampp folder.
- 解压缩到xampp文件夹。
- Copied php.ini file from old php folder into new one.
- 复制php。将旧php文件夹中的ini文件放入新的文件夹中。
- Copied a couple of folders that I didn't have in the new php folder, from old one. For example: extras, which contained browscap.ini file (this one is needed)
- 复制了一些我在新php文件夹中没有的文件夹,从旧文件夹中。例如:额外的,包含了browscap。ini文件(需要这个文件)
- Copied needed extensions, from old php ext folder into new php ext folder. I copied them manually, by checking list of extensions from php.ini file.
- 复制所需的扩展,从旧的php ext文件夹到新的php ext文件夹。我手动复制了它们,通过检查php扩展列表。ini文件。
- Copied also these files: php5apache2_2.dll, php5ts.dll
- 复制这些文件:php5apache2_2。dll,php5ts.dll
Hope that I covered everything.
希望我能涵盖一切。
Most probably these steps will not work if you change major versions of php, e.g. 5.3.x to 5.4.x, but for minor versions, it should work.
如果您更改了php的主要版本(例如5.3),那么这些步骤很可能不会起作用。5.4 x。但对于较小的版本,它应该起作用。
Also, a good way to see what's wrong... start command line and try to start httpd.exe, under xampp/apache/bin from there, it will list errors found.
还有,看看哪里出了问题……启动命令行并尝试启动httpd。exe,在xampp/apache/bin下,会出现错误。
#5
9
I think you need to actually download and install XAMPP with the desired PHP version. I dont think you can just upgrade the components of XAMPP individually unless there is a facility provided for this within XAMPP itself.
我认为您需要实际下载并安装XAMPP,并使用所需的PHP版本。我认为,除非XAMPP内部有一个设施,否则你不能单独升级XAMPP的组件。
#6
9
download your desired version of php binary from http://windows.php.net/download/ website. download Thread Safe binary zip version. Unzip the downloaded version of the PHP in a separate folder. Please make sure that your new php folder name is not "PHP". May be you can use filder name as the version name. For example for php 5.4 you can use php54.
从http://windows.php.net/download/网站下载你想要的php二进制版本。下载线程安全的二进制zip版本。将下载的PHP版本解压到单独的文件夹中。请确保您的新php文件夹名称不是“php”。可以使用filder名称作为版本名称。例如,对于php 5.4,您可以使用php54。
Copy the new php folder into your xampp folder. Now go to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. Change the following variables:
将新的php文件夹复制到xampp文件夹中。现在转到yourxampp/apache/conf/额外文件夹。httpd-xampp打开文件。从文件夹中额外获得conf。改变以下变量:
Variable PHPINIDir to be / Varaible LoadModule to be //php5apache2_2.dl
变量PHPINIDir为// Varaible LoadModule为//php5apache2_2.dl。
Save the file httpd-xampp.conf. Restart your XAMPP apache server. If your server get restarted successfully then your server php version is upgraded.
保存文件httpd-xampp.conf。重新启动XAMPP apache服务器。如果您的服务器成功重启,那么您的服务器php版本将被升级。
#7
6
I don't have enough reputation to comment yet, but, to add to ssharma's answer:
我还没有足够的名声来评论,但是,我想补充一下ssharma的回答:
After you copy your htdocs folder to a safe place, just export your databases from PHPmyadmin. Simply go to each of your databases and click on the export tab at the top. Export them as sql (or whatever, really - just remember what you chose). Upgrade your XAMPP installation. Now, in the new version of XAMPP, create the databases that you want to re-insert. Example: you have a database named 'test' that you exported from your old installation, name the new, empty database the same thing. Now, go into 'test' and hit the import button along the top (right next to the export button). Click on choose file, find the sql file that you exported earlier (should be 'test.sql') and import. Your tables and data will be in place.
将htdocs文件夹复制到安全位置后,只需从PHPmyadmin导出数据库。只需访问每个数据库并单击顶部的export选项卡。将它们导出为sql(或者其他的,真的——只要记住你选择了什么)。升级你的XAMPP安装。现在,在XAMPP的新版本中,创建您想要重新插入的数据库。示例:您有一个名为“test”的数据库,它从旧的安装中导出,将新的、空的数据库命名为相同的东西。现在,进入“测试”并按下顶部的导入按钮(就在出口按钮旁边)。单击choose file,找到您先前导出的sql文件(应该是test.sql)和导入。您的表和数据将就位。
NOTE: There's an option to export the entire collection of databases (it names the file 127.0.0.1.sql). But, I've never had much luck getting it to import correctly. Do each of your databases separately to ensure it works. I made this post kind of long-winded, but that's because I like to write for the people that don't know exactly what they're doing yet (I, myself, was there not too long ago (all of us were at some point)).
注意:有一个选项可以导出整个数据库集合(它命名文件127.0.0.1.sql)。但是,我从来没有很幸运地让它正确地导入。分别对每个数据库进行操作,以确保其正常工作。我把这篇文章写得有点冗长,但那是因为我喜欢为那些不知道自己在做什么的人写文章(我自己,不久前还在那里(我们都在某个时间点))。
Shorthand version of my answer:
1) Export your databases individually
2) Import into your new installation of XAMPP
我的回答的简写版本:1)将你的数据库单独导出到XAMPP的新安装中。
#8
5
There are newer beta versions of Xampp that come with newer PHP upgrades.
新版本的Xampp有较新的PHP升级版本。
you should check at http://www.apachefriends.org
你应该查看http://www.apachefriends.org。
#9
4
- Go to
phpinfo()
, press ctrl+f, and typethread
to check the value. - 转到phpinfo(),按下ctrl+f,并键入线程以检查该值。
- If it is enabled download the non thread safe version, otherwise download the thread safe version from here (zip).
- 如果启用了非线程安全版本,则从这里下载线程安全版本(zip)。
- Extract it, and rename the folder to
php
. - 提取它,并将文件夹重命名为php。
- Go to your xampp folder rename the default
php
folder to something else. - 转到xampp文件夹,将默认的php文件夹重命名为其他内容。
- Copy the extracted (renamed
php
) folder in xampp directory. - 在xampp目录中复制提取的(重命名的php)文件夹。
- Copy the
php.ini
file from default/oldphp
folder (That you renamed) and paste it into the newphp
folder. - 复制到php。ini文件从默认/旧php文件夹(您重新命名)并粘贴到新的php文件夹中。
- Restart xampp server and you're good to go.
- 重新启动xampp服务器,您很好。
#10
3
http://www.apachefriends.org/en/xampp-windows.html
http://www.apachefriends.org/en/xampp-windows.html
In this site you can get
在这个网站你可以得到。
XAMPP Add-Ons
XAMPP附加组件
by using this add on you can upgrade the latest versions.
通过使用这个插件,您可以升级最新版本。
#11
3
I have upgraded to php7.2 from php5.6
我已经从php5.6升级到php7.2。
Steps which I followed.
我跟着步骤。
- Download PHP binary from here. I have downloaded VC15 x86 Thread Safe Zip file.
- 从这里下载PHP二进制文件。我已经下载了VC15 x86线程安全Zip文件。
- Created a backup of xampp/php folder.
- 创建了xampp/php文件夹的备份。
- Extract all the contents of zip file to xampp/php folder.
- 将zip文件的所有内容提取到xampp/php文件夹。
- Copied php.ini (as I have modified it before and I want my configuration back, if you were using default one then skip this step.)
- 复制php。ini(我之前已经修改过了,我想要我的配置回来,如果你使用默认设置,那么跳过这个步骤)。
- Edit below file
- 编辑以下文件
C:\xampp\apache\conf\extra\http-xampp.conf
C:\ xampp \ apache \ conf \额外\ http-xampp.conf
- Replace
- 取代
LoadFile "C:/xampp/php/php5ts.dll"
LoadFile“C:/ xampp / php / php5ts.dll”
LoadFile "C:/xampp/php/libpq.dll"
LoadFile“C:/ xampp / php / libpq.dll”
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
LoadModule php5_module“C:/ xampp / php / php5apache2_4.dll”
to
来
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile“C:/ xampp / php / php7ts.dll”
LoadFile "C:/xampp/php/libpq.dll"
LoadFile“C:/ xampp / php / libpq.dll”
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
LoadModule php7_module“C:/ xampp / php / php7apache2_4.dll”
-
Replace php5_module to php7_module everywhere in this file.
在这个文件中,将php5_module替换为php7_module。
-
Restart Apache
重新启动Apache
#12
3
1) Backup your htdocs folder
2) export your databases (follow this tutorial)
3) uninstall xampp
4) install the new version of xampp
5) replace the htdocs folder that you have backed up
6) Import your databases you had exported before
1)备份你的htdocs文件夹2)导出你的数据库(跟随本教程)3)卸载xampp 4)安装新版本的xampp 5)替换你已经备份的htdocs文件夹,导入你之前导出的数据库。
Note: In case you have changed config files like PHP (php.ini), Apache (httpd.conf) or any other, please take back up of those files as well and replace them with newly installed version.
注意:如果您已经更改了PHP (PHP .ini)、Apache (httpd.conf)或任何其他的配置文件,请重新备份这些文件,并将它们替换为新安装的版本。
#13
2
1) Download new php from official site (better some zip). Old php
directory rename to php_old
and create again php
directory and put there unzipped files.
1)从官方网站下载新php(最好是zip)。旧的php目录将重命名为php_old,并重新创建php目录并将其解压缩文件。
In php.ini
connect needed modules if you used something that was turned off by default (like memcached etc.), but don't forget to add corresponding .dll
files.
在php中。如果您使用的是默认关闭的东西(比如memcached等),那么ini连接需要的模块,但是不要忘记添加相应的.dll文件。
2) In my case I had to update Apache. So repeat the same steps: download new package, rename directories, create new apache
directory and put there new files.
在我的例子中,我必须更新Apache。所以重复相同的步骤:下载新的包,重命名目录,创建新的apache目录,并放入新的文件。
Now you can try to restart apache running apache_start.bat
from xampp
folder (better run this bat, than restart apache service from Windows services window, cause in this case in console you'll see all errors if there will be some, including lines in config where you'll have problem). If you updated Apache and run this file, in the list of services you'll see Apache2.2, but in description you can get another version (in my case that was Apache/2.4.7).
现在您可以尝试重新启动apache运行apache_start。来自xampp文件夹的bat(最好运行这个bat,而不是从Windows服务窗口重启apache服务,因为在这种情况下,如果有一些错误,包括配置中的行,您将会看到所有的错误)。如果您更新了Apache并运行这个文件,在服务列表中您将看到Apache2.2,但是在描述中您可以得到另一个版本(在我的例子中是Apache/2.4.7)。
In case of Apache update you can get some problems, so mind:
在Apache更新的情况下,您可能会遇到一些问题,请注意:
-
after you replace the whole directory, you may need to configure you
apache/conf/httpd.conf
file (copy virtual hosts from old config, set up DocumentRoots, permissions for directories, all paths, extend list of index files (by default apache has onlyindex.html
so other index files will be just ignored and Apache will just list the site root directory in browser), configure you logs etc.)在您替换整个目录之后,您可能需要配置您的apache/conf/httpd。conf文件(从旧配置中复制虚拟主机,设置文档根,目录的权限,所有路径,扩展索引文件列表(默认情况下,apache只有索引)。html这样其他索引文件就会被忽略,Apache只会在浏览器中列出站点根目录,然后配置日志等等。
-
connect modules you need (if you used something that was not turned on by default like mod_rewrite etc.)
连接您需要的模块(如果您使用的是默认情况下没有打开的模块,比如mod_rewrite等)。
#14
2
I just upgrade my old XAMPP portable with PHP 5.3.X(Include Mercury & FileZilla & Tomcat) to XAMPP portable with PHP 5.6.X ( Include previous versions ) ...
My way:
我只是用PHP 5.3升级了我的旧XAMPP。X(包括Mercury & FileZilla & Tomcat)到XAMPP可携带PHP 5.6。X(包括以前的版本)…我的方法:
- First download last xampp portable(my using version: xampp-portable-win32-5.6.14-3-VC11Direct Download Link) Last XAMPP
- 第一个下载xampp可移植(我的使用版本:xampp-portable-win32-5.6.14-3 vc11direct下载链接)最后一个xampp。
- Extract new download file to drive d , because new version dont have mercury,filezilla,tomcat in it , then i copy these packages from my old version to new one
- 提取新的下载文件以驱动d,因为新版本中没有mercury、filezilla、tomcat,然后我将这些包从旧版本复制到新版本。
- Now on old xampp first copy all htdocs files to new xampp htdocs
- 现在,在老xampp上,首先将所有htdocs文件复制到新的xampp htdocs。
- Now on old xampp backup all of database in 5 two 10 separated sql files
- 现在,在旧的xampp备份所有数据库的5个2个10个分离的sql文件。
- Now on new xampp going and change some settings like
max_upload_size
and etc on php.ini and also in/apache/conf/extra/httpd-xampp.conf
- 现在,在新的xampp上,修改一些诸如max_upload_size之类的设置。ini,还有/apache/conf/extra/httpd-xampp.conf。
- Now delete ( make a rar archive and delete ) it , and copy new xampp from drive
D
to driveC
- 现在删除(做一个rar归档和删除),并从驱动器D复制新的xampp来驱动C。
- Now start new xampp , going to phpmyadmin , create a user and password that i use in previous xampp and add all privileges that user.
- 现在启动新的xampp,进入phpmyadmin,创建一个用户和密码,我在以前的xampp中使用,并添加用户的所有权限。
- Now going to import tab on phpmyadmin and separately import sql files.
- 现在要导入phpmyadmin并分别导入sql文件。
- Now i test xampp with all new features in drive C
- 现在我测试xampp的所有新特性在驱动C。
NOTE
On Export database tab on phpmyadmin, select UTF-8 Character and check Disable foreign key checks
checkbox
and on import tab uncheck Enable foreign key checks
.
在phpmyadmin上的导出数据库选项卡上,选择UTF-8字符,并检查禁用外键检查复选框,并在导入选项卡上取消启用外键检查。
#15
0
For Upgradation php in Xampp you can follow this steps, Else you can skip these 4 steps and direct install MAMP (for windows as well) from site and here is the direct download link
对于Xampp中的Upgradation php,您可以按照以下步骤操作,否则您可以跳过这4个步骤,直接在站点上安装MAMP(用于windows),这里是直接下载链接。
Step 1: Make backups Before starting, make sure to backup any settings, custom modules and most importantly the htdocs directory, which contains your scripts and page resources. This directory is normally located atC:\xampp\htdocs\
步骤1:在开始前进行备份,确保备份任何设置、定制模块,最重要的是包含您的脚本和页面资源的htdocs目录。该目录通常位于atC:\xampp\htdocs\。
Step 2: Preparation
步骤2:准备
Download PHP 5.3.0rc2. I use the VC6 build in order to minimise any potential compatibility issues. It is also recommended that you download the latest Windows version of XAMPP. While this is an upgrade guide that shouldwork with previous versions of XAMPP, it is recommended that a fresh copy of the core files is used. Stop any instances of the Apache service that might be running.
下载PHP 5.3.0rc2。我使用VC6构建来最小化任何潜在的兼容性问题。还建议您下载XAMPP的最新Windows版本。虽然这是与XAMPP的早期版本一起工作的升级指南,但建议使用核心文件的新副本。停止可能正在运行的Apache服务的任何实例。
Step 3: The upgrade This guide will assume your XAMPP directory is C:\xampp\
步骤3:本指南的升级将假定您的XAMPP目录是C:\ XAMPP \。
Extract the XAMPP archive to a directory of your choosing, I would recommend using the default C:\xampp\ Extract the contents of the PHP archive to C:\xampp\php\, overwriting the contents of this directory with the new files. Open the file C:\xampp\apache\conf\extra\httpd-xampp.conf and ensure the following lines are present in this order:
将XAMPP归档文件解压缩到您选择的目录中,我建议使用缺省的C:\ XAMPP \将PHP存档的内容提取到C:\ XAMPP \ PHP \,用新文件覆盖该目录的内容。打开文件C:\ xampp \ apache \ conf \额外\ httpd-xampp。conf并确保以下几行代码如下:
LoadFile "/xampp/php/php5ts.dll"
LoadModule php5_module "/xampp/apache/bin/php5apache2_2.dll"
Replace C:\xampp\php\php.ini with C:\xampp\php\php.ini-dist
Uncomment the lines:
;extension=php_mbstring.dll
;extension=php_pdo_sqlite.dll
Replace the line
magic_quotes_gpc = On
with
magic_quotes_gpc = Off
Copy all files in the C:\xampp\php\ to C:\xampp\apache\bin\ (do not copy the subdirectories or their contents).
将所有的文件复制到C:\xampp\php\到C:\xampp\apache\bin\(不要复制子目录或它们的内容)。
After following the above steps, restart your Apache service (this can be done using C:\xampp\xampp-control.exe or manually through the control panel/command prompt). Your PHPinfo should indicate that the upgrade has been successful. I will update this post if I discover any problems from using this method, or a cleaner (automated) means of performing the upgrade.
在执行上述步骤之后,重新启动您的Apache服务(可以使用C:\xampp\ xamppcontrol来完成)。exe或手动通过控制面板/命令提示符。您的PHPinfo应该表明升级已经成功。如果发现使用此方法的任何问题,或者使用更干净的(自动化的)进行升级的方法,我将更新这篇文章。