在 Windows 版 XAMPP 中升级 PHP?

发布于 2024-08-19 23:33:42 字数 99 浏览 3 评论 0原文

我想知道如何在 Xampp for Windows 中升级 PHP?我尝试从 PHP 主站点下载最新的 PHP 版本,但当我检查 (phpinfo) 时,我仍然发现以前的版本仍在使用。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(19

萌︼了一个春 2024-08-26 23:33:43

Xampp 有较新的 Beta 版本,附带有较新的 PHP 升级。

你应该检查 http://www.apachefriends.org

There are newer beta versions of Xampp that come with newer PHP upgrades.

you should check at http://www.apachefriends.org

稳稳的幸福 2024-08-26 23:33:43

我已通过从此处下载文件将 PHP 更新到 8。
https://sourceforge.net/projects/xampp/files/XAMPP %20Windows/8.0.6/

通过将之前的 PHP 文件夹重命名为其他名称,将其上传到 xampp 目录。但是,在启动 apache 时出现以下错误。

Error: Apache shutdown unexpectedly.
This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums

之后,我也用我下载的新版本替换了 xampp 文件夹中的 apache 目录,它解决了问题。

尝试访问 phpmyadmin 页面时遇到另一个问题,然后再次从 xampp 目录中重命名以前的 phpmyadmin 文件夹,并从下载的文件上传新版本。它解决了这个问题。

I've updated the PHP to 8 by downloading the files from here.
https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/8.0.6/

Uploaded it to the xampp directory by renaming the previous PHP folder to something else. But, then got the following error while starting the apache.

Error: Apache shutdown unexpectedly.
This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums

After that, I've replaced the apache directory as well from the xampp folder with a newer version which I've downloaded, it sorted the issue out.

Got another problem while trying to access the phpmyadmin page, then again renamed the previous phpmyadmin folder from the xampp directory and uploaded the new version from the downloaded files. It's fixed the issue.

甜妞爱困 2024-08-26 23:33:43

http://www.apachefriends.org/en/xampp-windows.html

在此站点中您可以获得

XAMPP 附加组件,

通过使用此附加组件您可以升级到最新版本。

http://www.apachefriends.org/en/xampp-windows.html

In this site you can get

XAMPP Add-Ons

by using this add on you can upgrade the latest versions.

柒夜笙歌凉 2024-08-26 23:33:43

我刚刚将旧的 PHP 5.3.X 便携式 XAMPP(包括 Mercury 和 FileZilla 和 Tomcat)升级到 PHP 5.6.X 便携式 XAMPP(包括以前的版本)...
我的方法:

  1. 首先下载最后一个xampp portable(我使用的版本:xampp-portable-win32-5.6.14-3-VC11直接下载链接) Last XAMPP
  2. 将新的下载文件提取到驱动器 d ,因为新版本中没有汞,filezilla,tomcat,然后我将这些包从旧版本复制到新版本
  3. 现在在旧的xampp上,首先将所有htdocs文件复制到新的xampp htdocs
  4. 现在,在旧的xampp上,将所有数据库备份为5个两个10个独立的sql文件
  5. 现在,在新的xampp上,更改一些设置,例如php上的max_upload_size等.ini 以及 /apache/conf/extra/httpd-xampp.conf
  6. 现在删除(制作 rar 存档并删除)它,并从驱动器 D 复制新的 xampp驱动 C
  7. 现在启动新的 xampp ,转到 phpmyadmin ,创建我在以前的 xampp 中使用的用户和密码,并添加该用户的所有权限。
  8. 现在要在 phpmyadmin 上导入选项卡并单独导入 sql 文件。
  9. 现在我用驱动器 C 中的所有新功能测试 xampp

注意
在 phpmyadmin 的“导出数据库”选项卡上,选择“UTF-8 字符”并选中“禁用外键检查”复选框
并在导入选项卡上取消选中启用外键检查

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:

  1. First download last xampp portable(my using version: xampp-portable-win32-5.6.14-3-VC11Direct Download Link) Last XAMPP
  2. 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
  3. Now on old xampp first copy all htdocs files to new xampp htdocs
  4. Now on old xampp backup all of database in 5 two 10 separated sql files
  5. 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
  6. Now delete ( make a rar archive and delete ) it , and copy new xampp from drive D to drive C
  7. Now start new xampp , going to phpmyadmin , create a user and password that i use in previous xampp and add all privileges that user.
  8. Now going to import tab on phpmyadmin and separately import sql files.
  9. Now i test xampp with all new features in drive 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.

梦旅人picnic 2024-08-26 23:33:43

1) 备份您的 htdocs 文件夹
2) 导出数据库(按照教程进行操作)

3) 卸载xampp

4)安装新版本的xampp

5) 替换您已备份的 htdocs 文件夹

6) 导入您之前导出的数据库

注意:如果您更改了配置文件,例如 PHP (php.ini)、Apache (httpd.conf) 或任何其他文件,请备份也删除这些文件并将其替换为新安装的版本。

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

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.

陌上青苔 2024-08-26 23:33:43

要在 xampp 中更新最新的 PHP 版本而不丢失 htdocs 数据,您需要从 sourceforge.net 下载所需 PHP 版本的 zip 文件,然后从提取的文件中复制 PHP 文件夹并将其粘贴到您的 xampp 文件夹中。

注意:不要忘记重命名已存在的旧 PHP 文件夹。

然后只需使用当前路径编辑 php.ini 文件即可到达正确的 PHP 文件夹。

之后,您需要重新运行 xampp。

我在 youtube 上找到了一个视频,可以帮助你。
如何更新xampp中的php版本

To update with latest PHP version in xampp without losing your htdocs data you need to download the zip file of your desired version of PHP from sourceforge.net, then copy the PHP folder from the extracted file and paste it into your xampp folder.

NOTE: Don't forget to rename the old PHP file folder which already exists.

Then simply edit your php.ini file with the current path to reach the right PHP folder

After that, you need to re-run your xampp.

I found a video on youtube which can help you.
how to update php version in xampp

丶视觉 2024-08-26 23:33:43

如何正确更新 XAMPP 和 PHP 8.x

请注意,不建议将 XAMPP 中的旧版本 PHP 替换为新版本,因为这可能会由于以下原因而引入问题和不兼容问题:不打算一起使用的工具、配置和代码库。

相反,更新 XAMPP 的 PHP 版本的安全、推荐的方法是将其连同 PHP 需要使用的二进制文件(即 MySQL 和 PHPMyAdmin)一起更新到与 PHP 版本兼容的版本。通过这种方式,您还可以利用更新到新版本的安全性和速度优势 - 例如,现代版本的 PHPMyAdmin 比几年前的版本要快得多,而且错误少得多。

不幸的是,没有简单的方法来更新 XAMPP,考虑到它作为一个项目的历史和成熟度,这很奇怪,但下面的步骤概述了最简单的方法。


  1. 将当前工作的 XAMPP 文件夹(默认位于 C:\xampp)重命名为 XAMPP.old 或类似的名称以指示这是旧版本。

  2. 下载您想要的 XAMPP/PHP 版本的 XAMPP 安装程序 XAMPP 版本镜像 PHP 版本,以便更轻松地了解您所获得的 PHP 版本),并将其安装到 C:\xampp

  3. 完成安装过程,随意取消选择任何不需要的软件(例如 Mercury Mail 和 Tomcat),以防止它们扰乱您的安装,然后等待安装完成。

  4. C:\xampp 中删除以下文件夹,并从 C:\xampp.old 中复制并粘贴其等效项:

    htdocs
    mysql\数据
    mysql\备份
    

您现在已将所有网站和数据库数据移至从您上次安装开始,因此如果您没有对 XAMPP 配置进行太多自定义或不关心将配置移过来,您可以在此阶段停止,您将在新版本上运行完整的 XAMPP 安装PHP 以及与其兼容的新软件。


接下来,您需要将配置文件从位于 C:\xampp.old 的旧 XAMPP 安装复制到位于 C:\xampp 的新安装。

首先是 php\php.ini 文件 - 该文件不应该简单地复制,因为它包含特定于当前 PHP 安装的配置选项。如果您对其进行了更改或者不确定是否进行了更改,则可以使用 diff 工具,例如 diff --color -y 将旧的 php.ini 文件与刚刚安装的文件进行比较 - 如果您看到任何红色行,这些是您可能需要复制到新的 C:\xampp\php.ini 文件中的行,但请注意,其中许多行可能是不必要的 - 通常它们会被开发人员删除,因为它们新的 PHP 版本不再需要。

剩余的配置文件和文件夹可以简单地复制到 C:\xampp 上的相同位置,替换较新的版本:

apache\conf\httpd.conf
apache\conf\ssl.crt
apache\conf\ssl.csr
apache\conf\ssl.key
phpmyadmin\config.inc.php
apache\conf\extra\httpd-vhosts.conf

所有这些更改都应该非常安全,但最好保留当您测试新的 XAMPP 服务器时,C:\xampp.old 文件夹会保留几周。如果发现您遗漏了某些内容,您可以稍后将其复制过来。

您现在应该能够打开 XAMPP 控制面板来启动服务器并确认新版本的 Apache 和 MySQL 正在运行,并访问 localhost/phpmyadmin 来确认最新版本的 PHPMyAdmin 已安装安装成功。最后,运行 php -v 来确认您使用的是已安装的 PHP 版本。

How to properly update XAMPP and PHP 8.x

Note that it's not recommended to just swap out an older version of PHP in XAMPP to a newer version, as there's the possibility it could introduce problems and incompatibilities due to tools, configurations and codebases that weren't intended to be used together.

Instead, the safe, recommended way to update XAMPP's PHP version is to update it along with the binaries that PHP needs to work with - namely MySQL and PHPMyAdmin - to versions that are compatible with the version of PHP. This way you will also be able to take advantage of the security and speed advantages of updating to newer versions - for example, modern versions of PHPMyAdmin are miles faster and much less buggy than versions that are a few years old.

Unfortunately there is no easy way to update XAMPP, which is bizarre considering how old and mature it is as a project, but the steps below outline the easiest way to do so.


  1. Rename your current, working XAMPP folder (located at C:\xampp by default) to XAMPP.old or something similar to indicate it's the old version.

  2. Download the XAMPP installer for the version of XAMPP/PHP you want (the XAMPP version mirrors the PHP version to make it easier to know which PHP version you're getting), and install it to C:\xampp.

  3. Go through the install process and feel free to deselect any software you don't need - like Mercury Mail and Tomcat - to prevent them cluttering up your installation, then wait for the install to complete.

  4. Delete the following folders from C:\xampp and copy and paste their equivalents from C:\xampp.old:

    htdocs
    mysql\data
    mysql\backup
    

You've now moved all of your website and database data over from your last installation, so if you didn't customise your XAMPP configuration a lot or don't care about moving your configuration over, you can stop at this stage and you will have a fully-working installation of XAMPP running on your new version of PHP, along with new software that is compatible with it.


Next, you need to copy over the configuration files from your old XAMPP installation at C:\xampp.old to the new one at C:\xampp.

First is the php\php.ini file - this file should not simply be copied over, as it contains configuration options that are very specific to the current PHP installation. If you've made changes to it or you're not sure whether you have, you can use a diff tool like diff --color -y <old php.ini> <new php.ini> to compare your old php.ini file with the one you just installed - if you see any lines in red, these are the lines you might need to copy over to your new C:\xampp\php.ini file, although note that even many of these might be unnecessary - usually they are removed by the developers because they're no longer needed by the newer PHP version.

The remaining configuration files and folders can simply be copied below into the same locations on C:\xampp, replacing the newer versions:

apache\conf\httpd.conf
apache\conf\ssl.crt
apache\conf\ssl.csr
apache\conf\ssl.key
phpmyadmin\config.inc.php
apache\conf\extra\httpd-vhosts.conf

All of these changes should be pretty safe but it's always a good idea to keep the C:\xampp.old folder around for a few weeks while you're testing out your new XAMPP server. If it turns out you missed something you can then just copy it over later.

You should now be able to open the XAMPP Control Panel to start the server and confirm that your new versions of Apache and MySQL are working, and visit localhost/phpmyadmin to confirm that the latest version of PHPMyAdmin has been installed successfully. Finally, run php -v to confirm that you're on the installed version of PHP.

够钟 2024-08-26 23:33:43

1) 从官方网站下载新的 PHP(最好是 zip)。旧的 php 目录重命名为 php_old 并再次创建 php 目录并将解压缩的文件放在那里。

如果您使用默认情况下关闭的内容(例如 Memcached 等),请在 php.ini 中连接所需的模块,但不要忘记添加相应的 .dll 文件。

2) 就我而言,我必须更新 Apache。因此,重复相同的步骤:下载新包、重命名目录、创建新的 apache 目录并放入新文件。

现在,您可以尝试从 xampp 文件夹中运行 apache_start.bat 重新启动 apache(最好运行此bat,而不是从 Windows 服务窗口重新启动 apache 服务,因为在这种情况下,在控制台中您如果有的话,会看到所有错误,包括配置中出现问题的行)。如果您更新了 Apache 并运行此文件,在服务列表中您将看到 Apache2.2,但在描述中您可以获得另一个版本(在我的例子中是 Apache/2.4.7)。

如果 Apache 更新,您可能会遇到一些问题,因此请注意:

  • 替换整个目录后,您可能需要配置 apache/conf/httpd.conf 文件(从旧配置,设置 DocumentRoots,目录权限,所有路径,扩展索引文件列表(默认情况下 apache 只有 index.html 所以其他索引文件将被忽略,Apache 将仅列出 从

  • 连接您需要的模块(如果您使用了默认情况下未打开的模块,例如 mod_rewrite 等)

1) Download new PHP from the official site (better some zip). Old php directory rename to php_old and create again php directory and put there unzipped files.

In php.ini connect needed modules if you used something that was turned off by default (like Memcached etc.), but doesn't forget to add corresponding .dll files.

2) In my case, I had to update Apache. So repeat the same steps: download the new package, rename directories, create new apache directory and put their new files.

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).

In case of Apache update you can get some problems, so mind:

  • 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 the list of index files (by default apache has only index.html so other index files will be just ignored and Apache will just list the site root directory in browser), configure you logs etc.)

  • connect modules you need (if you used something that was not turned on by default like mod_rewrite etc.)

攀登最高峰 2024-08-26 23:33:43

注意

为了在升级后运行 apache 服务器,PHP 7.4.x 需要 Microsoft Visual C++ Redistributable for Visual Studio 2019,可以下载 此处标题下 其他工具和框架。否则apache服务器将无法启动。

Note

In order to run apache server after upgradation PHP 7.4.x requires Microsoft Visual C++ Redistributable for Visual Studio 2019 which can be downloaded here under the heading Other Tools and Frameworks. otherwise apache server won't start.

煞人兵器 2024-08-26 23:33:43

对于 Xampp 中的升级 php,您可以按照以下步骤操作,否则您可以跳过这 4 个步骤并直接从 网站,这里是 直接下载链接

第 1 步: 进行备份
在开始之前,请确保备份所有设置、自定义模块以及最重要的 htdocs 目录,其中包含脚本和页面资源。该目录通常位于 C:\xampp\htdocs\

第 2 步: 准备工作

下载 PHP 5.3.0rc2。我使用 VC6 构建是为了最大限度地减少任何潜在的兼容性问题。
还建议您下载最新的 Windows 版本的 XAMPP。虽然这是一个适用于以前版本的 XAMPP 的升级指南,但建议使用核心文件的全新副本。
停止任何可能正在运行的 Apache 服务实例。

第 3 步:升级
本指南将假设您的 XAMPP 目录为 C:\xampp\

将 XAMPP 存档提取到您选择的目录,我建议使用默认的 C:\xampp\
将 PHP 存档的内容提取到 C:\xampp\php\,用新文件覆盖该目录的内容。
打开文件 C:\xampp\apache\conf\extra\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

将 C:\xampp\php\ 中的所有文件复制到 C:\xampp\apache\bin\ (不要
复制子目录或其内容)。

执行上述步骤后,重新启动 Apache 服务(可以使用 C:\xampp\xampp-control.exe 或通过控制面板/命令提示符手动完成)。您的 PHPinfo 应该表明升级已成功。
如果我发现使用此方法或执行升级的更干净(自动)方法有任何问题,我将更新这篇文章。

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

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\

Step 2: Preparation

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.

Step 3: The upgrade
This guide will assume your XAMPP directory is 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:

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).

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.

时光沙漏 2024-08-26 23:33:42

备份您的 htdocs 和 data 文件夹(MySQL 文件夹的子文件夹),重新安装升级版本并替换这些文件夹。

注意:
如果您更改了 PHP (php.ini)、Apache (httpd.conf) 或任何其他配置文件,请同时备份这些文件并将其替换为新安装的版本。

Take a backup of your htdocs and data folder (subfolder of MySQL folder), reinstall upgraded version and replace those folders.

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.

你与昨日 2024-08-26 23:33:42

XAMPP 中升级 PHP 的最简单方法:

  1. 下载最新的可移植版本的 XAMPP
  2. 解压缩存档(不在已安装 XAMPP 的位置)。
  3. 从提取的存档中复制 PHP 文件夹。
  4. 备份已安装的 XAMPP 目录中的 PHP 文件夹。您可以备份它,就像将 PHP 文件夹名称更改为 PHP-old
    就像 PHP-version-number
  5. 粘贴您从提取的存档中复制的 PHP 文件夹。
  6. 如果您之前更改了默认设置,请将 php.ini 文件替换为备份文件夹 php.ini 文件。
  7. 就这样,启动/重新启动服务器

Simplest method to upgrade PHP in XAMPP:

  1. Download latest portable version of XAMPP.
  2. Extract the archive(not where XAMPP already installed).
  3. Copy the PHP folder from the extracted archive.
  4. Keep back up of PHP folder which is in installed XAMPP directory. You can backup it like changing the PHP folder name to PHP-old or
    like PHP-version-number
  5. Paste the PHP folder which you copied from the extracted archive.
  6. Replace the php.ini file with your backup folder php.ini file in case you have changed the default settings earlier.
  7. That's all, start/restart the server.
银河中√捞星星 2024-08-26 23:33:42

您可以浏览以下链接,因为它对我有帮助,也应该对您有用。 http://hype-free.blogspot .com/2007/07/updating-php-in-xampp-for-windows.html

意识到我的答案帮助了几个用户,这里是原始链接的编辑:

编辑:

首先始终备份您的数据。

  1. 下载最新的 PHP 二进制版本(确保获取 .zip 包而不是安装程序)
  2. 将其解压缩到一个目录
  3. ,覆盖 XAMPP 安装目录的 php 子文件夹中的目录内容。
  4. 使用较新的版本覆盖目录 apache\bin 的内容。
  5. 现在的技巧:获取名称中包含“_2”的文件(例如 php5apache2_2.dll 或 php5apache2_2_filter.dll),将它们复制到 apache\bin 子目录中并删除“_2”部分,覆盖现有文件。这是必要的,因为 XAMPP 使用 Apache 版本 2.2,并且带有 2 前缀的文件是为 Apache 2.0 构建的,因此您必须为较新版本(具有不同的插件接口)构建文件,并将它们重命名为 XAMPP 期望的文件名。

注意:XAMPP安装中有两个目录需要更新新版本的文件,即php子目录和apache/bin子目录。

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

Realizing that my answer helped couple of users, here is the edit from original link:

Edit:

First of all Always backup your data.

  1. Download the latest binary version of PHP (make sure to get the .zip package not the installer)
  2. De-archive it to a directory
  3. Overwrite the contents of directory in the php subfolder of your XAMPP installation directory.
  4. Overwrite the contents of the directory apache\bin with the newer versions.
  5. 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.

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.

溺深海 2024-08-26 23:33:42

php5.6 升级到 php7.2

我已按照我所遵循的步骤

  1. 。从此处下载 PHP 二进制文件。我已经下载了 VC15 x86 Thread Safe Zip 文件。
  2. 创建了 xampp/php 文件夹的备份。
  3. 将 zip 文件的所有内容提取到 xampp/php 文件夹。
  4. 复制 php.ini (因为我之前修改过它,我希望恢复我的配置,如果您使用默认配置,则跳过此步骤。)
  5. 编辑以下文件

C:\xampp\apache\conf\extra\http-xampp.conf

5.1。代替

加载文件“C:/xampp/php/php5ts.dll”

加载文件“C:/xampp/php/libpq.dll”

LoadModule php5_module“C:/xampp/php/php5apache2_4.dll”

加载文件“C:/xampp/php/php7ts.dll”

加载文件“C:/xampp/php/libpq.dll”

LoadModule php7_module“C:/xampp/php/php7apache2_4.dll”

  1. 重新启动Apache

I have upgraded to php7.2 from php5.6

Steps which I followed.

  1. Download PHP binary from here. I have downloaded VC15 x86 Thread Safe Zip file.
  2. Created a backup of xampp/php folder.
  3. Extract all the contents of zip file to xampp/php folder.
  4. 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.)
  5. Edit below file

C:\xampp\apache\conf\extra\http-xampp.conf

5.1. Replace

LoadFile "C:/xampp/php/php5ts.dll"

LoadFile "C:/xampp/php/libpq.dll"

LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"

to

LoadFile "C:/xampp/php/php7ts.dll"

LoadFile "C:/xampp/php/libpq.dll"

LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"

  1. Restart Apache
谈场末日恋爱 2024-08-26 23:33:42

我需要将我的 php 从 5.3.8 更新到 5.3.29。 (均为线程安全)在 Windows

我所做的步骤:

  1. 备份 xampp 下的初始 php 文件夹。
  2. 从这里下载了zip
    http://windows.php.net/download/#php-5.3-ts-VC9- x86
  3. 将该 zip 解压到 xampp 文件夹中。
  4. 将 php.ini 文件从旧 php 文件夹复制到新文件夹中。
  5. 在新的 php 文件夹中复制了几个我没有的文件夹,
    从旧的。例如:extras,其中包含browscap.ini文件
    (需要这个)
  6. 将所需的扩展从旧的 php ext 文件夹复制到新的 php 中
    ext 文件夹。我通过检查 php.ini 文件中的扩展列表来手动复制它们。
  7. 还复制了这些文件:php5apache2_2.dll、php5ts.dll

希望我涵盖了所有内容。

如果您更改 php 的主要版本(例如 5.3.x 到 5.4.x),这些步骤很可能不起作用,但对于次要版本,它应该起作用。

另外,这是查看问题所在的好方法...启动命令行并尝试在 xampp/apache/bin 下启动 httpd.exe,它将列出发现的错误。

I needed to update my php from 5.3.8 to 5.3.29. (both Thread Safe) on Windows

Steps I did:

  1. Back-up my initial php folder, under xampp.
  2. Downloaded zip from here
    http://windows.php.net/download/#php-5.3-ts-VC9-x86
  3. Unpack that zip into xampp folder.
  4. Copied php.ini file from old php folder into new one.
  5. 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)
  6. 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.
  7. Copied also these files: 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.

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.

怪我鬧 2024-08-26 23:33:42

我认为您需要实际下载并安装具有所需 PHP 版本的 XAMPP。我认为您不能单独升级 XAMPP 的组件,除非 XAMPP 本身提供了为此提供的工具。

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.

才能让你更想念 2024-08-26 23:33:42

http://windows.php.net/download/ 网站下载所需版本的 php 二进制文件。下载线程安全二进制 zip 版本。
将下载的 PHP 版本解压到单独的文件夹中。
请确保您的新 php 文件夹名称不是“PHP”。也许您可以使用文件夹名称作为版本名称。例如,对于 php 5.4,您可以使用 php54。

将新的 php 文件夹复制到您的 xampp 文件夹中。现在转到您的 xampp/apache/conf/extra 文件夹。从 extra 文件夹中打开文件 httpd-xampp.conf。更改以下变量:

变量 PHPINIDir 为 /
变量 LoadModule 为 //php5apache2_2.dl

保存文件 httpd-xampp.conf。重新启动您的 XAMPP apache 服务器。如果您的服务器成功重新启动,则您的服务器 php 版本已升级。

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.

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:

Variable PHPINIDir to be /
Varaible LoadModule to be //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.

梓梦 2024-08-26 23:33:42

我还没有足够的声誉来发表评论,但是,要添加到 ssharma 的答案中:

将 htdocs 文件夹复制到安全位置后,只需从 PHPmyadmin 导出数据库即可。只需转到每个数据库并单击顶部的导出选项卡即可。将它们导出为 sql(或其他任何形式,实际上 - 只需记住您选择的内容即可)。升级您的 XAMPP 安装。现在,在新版本的 XAMPP 中,创建要重新插入的数据库。示例:您有一个从旧安装中导出的名为“test”的数据库,将新的空数据库命名为相同的名称。现在,进入“测试”并点击顶部的导入按钮(导出按钮旁边)。单击“选择文件”,找到之前导出的 sql 文件(应为“test.sql”)并导入。您的表格和数据将就位。

注意:有一个选项可以导出整个数据库集合(其将文件命名为 127.0.0.1.sql)。但是,我从来没有运气好让它正确导入。分别执行每个数据库以确保其正常工作。我写这篇文章有点啰嗦,但那是因为我喜欢为那些还不知道自己在做什么的人写作(我本人不久前也在那里(我们所有人都在某个地方)观点))。

我的答案的简写版本:
1) 单独导出您的数据库
2) 导入到新安装的 XAMPP 中

I don't have enough reputation to comment yet, but, to add to ssharma's answer:

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.

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)).

Shorthand version of my answer:
1) Export your databases individually
2) Import into your new installation of XAMPP

魂归处 2024-08-26 23:33:42
  1. 转到 phpinfo(),按 ctrl+f,然后输入 thread 检查值。
  2. 如果启用,则下载非线程安全版本,否则从此处下载线程安全版本 (zip) 。
  3. 解压它,并将文件夹重命名为 php
  4. 转到您的 xampp 文件夹,将默认的 php 文件夹重命名为其他名称。
  5. 将提取的(重命名为 php)文件夹复制到 xampp 目录中。
  6. 从默认/旧 php 文件夹(您重命名的)复制 php.ini 文件,并将其粘贴到新的 php 文件夹中。
  7. 重新启动 xampp 服务器就可以了。
  1. Go to phpinfo(), press ctrl+f, and type thread to check the value.
  2. If it is enabled download the non thread safe version, otherwise download the thread safe version from here (zip).
  3. Extract it, and rename the folder to php.
  4. Go to your xampp folder rename the default php folder to something else.
  5. Copy the extracted (renamed php) folder in xampp directory.
  6. Copy the php.ini file from default/old php folder (That you renamed) and paste it into the new php folder.
  7. Restart xampp server and you're good to go.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文