XAMPP: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
[http://www.apachefriends.org/en/xampp.html XAMPP](all old version and latest version of XAMPP [http://sourceforge.net/projects/xampp/files/ files])
[http://www.apachefriends.org/en/xampp.html XAMPP](all old version and latest version of XAMPP [http://sourceforge.net/projects/xampp/files/ files])
== installation ==
{{Software version| software=XAMPP | url=http://www.apachefriends.org/en/xampp.html |  version=5.6.3}}
# Download the [https://www.apachefriends.org/index.html XAMPP Installers] and install
# Configure the Windows {{kbd | key=PATH}} if you want to run the PHP script from command line ([[How to setup my system path]]). And(replace the {{kbd | key=X}} to other folder where XAMPP installed)<ref>[http://stackoverflow.com/questions/10753024/how-to-access-the-command-line-for-xampp-on-windows php - how to access the command line for xampp on windows - Stack Overflow]</ref><pre>;X:\xampp\mysql\bin;X:\xampp\php;</pre>
# Restart the command line window to make sure the {{kbd | key=PATH}} updated!


== Roll back to the old version of [http://www.mysql.com/ MySQL] at XAMPP ==
== Roll back to the old version of [http://www.mysql.com/ MySQL] at XAMPP ==
=== Modify the configuration of MySQL(optional) ===
=== Method1: use the same folder name for old version of MySQL  ===
modify the path of basedir, datadir, Server in [http://www.mysql.com/ MySQL] conf file: %windir%\my.ini
# stop the ongoing MySQL service
# move the new version of MySQL to different holder ex: move C:/mysql to C:/mysql_new
# move the old version of MySQL to original holder ex: move C:/mysql_old to C:/mysql
# restart the MySQL service
 
=== Method2: use the different folder name for old version of MySQL ===
==== Modify the configuration of MySQL(optional) ====
modify the path of basedir, datadir, Server in [http://www.mysql.com/ MySQL] conf file: %windir%\my.ini or {xampp}\mysql\data\my.ini
<pre>
<pre>
[mysqld]
[mysqld]
Line 19: Line 32:
</pre>
</pre>


=== Modify the path of MySQL service ===
 
==== Modify the path of MySQL service ====
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\mysql\ImagePath
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\mysql\ImagePath
* original: "C:\Program Files\xampp\mysql\bin\mysqld-nt.exe" "--defaults-file=C:\Program Files\xampp\mysql\bin\my.cnf" mysql
* original: "C:\Program Files\xampp\mysql\bin\mysqld-nt.exe" "--defaults-file=C:\Program Files\xampp\mysql\bin\my.cnf" mysql
Line 26: Line 40:
restart the MySQL service
restart the MySQL service


== PHP path ==
* on {{Mac}} {{kbd | key=<nowiki>/Applications/xampp/bin/php</nowiki>}}
<pre>
# How to verify the PHP path
% /Applications/xampp/bin/php  --version
PHP 8.1.17 (cli) (built: Apr  6 2023 05:03:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies
</pre>


== Troubleshottings ==
== Troubleshottings ==
Line 38: Line 62:


== upgrade xampp ==
== upgrade xampp ==
* re-check the installation file path of xampp in the conf files of Apache, PHP, Mysql (ex: xampp was installed at d:\xampp, the conf files was written as d:d:\xampp) [XAMPP v1.7.5]
* Before upgrade the xampp, remember backup the files under {xampp} and htdocs
** filezilla server: {xampp}\FileZillaFTP\FileZilla Server.xml
* re-check the installation file path of xampp in the conf files of Apache, PHP, Mysql {{exclaim}} (ex: xampp was installed at d:\xampp, the conf files was written as d:d:\xampp after upgraded) [XAMPP v1.7.5]
* Move the folder of old PHP extension files and install new one after installed new version of XAMPP. Else the folder of PHP extension files will not be overwrote during the installation. The missing PHP extension will cause Apache starting-problems
** apache configuration files: located {xampp}\apache\conf\*.conf
** PHP configuration files: located {xampp}\php\php.ini
** MySQL configuration file: located {xampp}\mysql\bin\my.ini
** filezilla server: {xampp}\FileZillaFTP\FileZilla Server.xml (ex: the location of shared folders was required to replace D:D:\xampp with D:\xampp after upgraded)
* Move the folder of old PHP extension files and install new one after installed new version of XAMPP. Else the folder of PHP extension files will not be overwrote during the installation. The missing PHP extension will cause Apache stop to launch.
 
 
restart the MySQL service
 
 
== change the MySQL port ==
For AppServ or MySQL Server 5.6
* Windows: '''Start''' -> '''Control Panel''' -> '''Administrative Tools''' -> '''Services''' -> stop the '''MySQL''' service
* open the MySQL configuration file: {{exclaim}} location of configuration file: You can check the path from  '''Services''' -> '''MySQL''' service -> (Right mouse click the service name) '''Content''' -> '''Path to executable''', and find the parameter of --defaults-file
** For MySQL Server 5.6: x:\ProgramData\MySQL\MySQL Server 5.6\my.ini <ref>"x:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --defaults-file="x:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56</ref> {{exclaim}} not the file located: x:\Program Files\MySQL\MySQL Server 5.6\my-default.ini
** For AppServ v.2.5.10: x:\AppServ\MySQL\my.ini <ref>x:\AppServ\MySQL\bin\mysqld-nt --defaults-file=x:\AppServ\MySQL\my.ini mysql</ref>
* modify the MySQL configuration file
** find this line: port=3306, and change the port what you want ex: 3307. And save the configuration file.
* restart the MySQL service
* (optional) If you using [http://www.phpmyadmin.net/home_page/index.php phpMyAdmin] for MySQL management, you need to change port setting of the phpMyAdmin config file.
 
 
 
AppServ 修改 MySQL 的 port
* Windows: 控制台 -> 系統管理工具 -> 服務:停用 mysql 服務
* 修改 MySQL 設定檔,檔案位置 For AppServ v.2.5.10: x:\AppServ\MySQL\my.ini
* 找到這一行: port=3306, 修改成你想要的 port 例如 3307,儲存設定檔
* 控制台 -> 系統管理工具 -> 服務:啟用 mysql 服務




== References ==
<references/>


[[Category:Server]]
[[Category:Server]]
[[Category:Web server software]]

Latest revision as of 14:33, 18 August 2023

XAMPP(all old version and latest version of XAMPP files)

installation[edit]

XAMPP v.5.6.3


  1. Download the XAMPP Installers and install
  2. Configure the Windows PATH if you want to run the PHP script from command line (How to setup my system path). And(replace the X to other folder where XAMPP installed)[1]
    ;X:\xampp\mysql\bin;X:\xampp\php;
  3. Restart the command line window to make sure the PATH updated!

Roll back to the old version of MySQL at XAMPP[edit]

Method1: use the same folder name for old version of MySQL[edit]

  1. stop the ongoing MySQL service
  2. move the new version of MySQL to different holder ex: move C:/mysql to C:/mysql_new
  3. move the old version of MySQL to original holder ex: move C:/mysql_old to C:/mysql
  4. restart the MySQL service

Method2: use the different folder name for old version of MySQL[edit]

Modify the configuration of MySQL(optional)[edit]

modify the path of basedir, datadir, Server in MySQL conf file: %windir%\my.ini or {xampp}\mysql\data\my.ini

[mysqld]
basedir=C:/mysql_old
datadir=C:/mysql_old/data

log-error=C:/mysql_old/data/mysql-error.log

log-slow-queries = C:/mysql_old/data/mysql-slow.log
long_query_time = 5
log-long-format

[WinMySQLadmin]
Server=C:/mysql_old/bin/mysqld-nt.exe


Modify the path of MySQL service[edit]

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\mysql\ImagePath

  • original: "C:\Program Files\xampp\mysql\bin\mysqld-nt.exe" "--defaults-file=C:\Program Files\xampp\mysql\bin\my.cnf" mysql
  • old version: "C:\mysql_old\bin\mysqld-nt.exe" "--defaults-file=C:\mysql_old\bin\my.cnf" mysql

restart the MySQL service

PHP path[edit]

  • on macOS icon_os_mac.png /Applications/xampp/bin/php
# How to verify the PHP path
 % /Applications/xampp/bin/php  --version
PHP 8.1.17 (cli) (built: Apr  6 2023 05:03:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies

Troubleshottings[edit]

  • Could not link to the localhost after executed the xampp_start.exe! [XAMPP Lite 1.6.3a]
    • Check the port (execute the file: xampp-portcheck.exe )! Port 80 was occupied by some softwares, such as
      • Skype
      • Gladinet Cloud Desktop
    • Check the AntiVirus software (ex: Pause the Nod32) and security settings!
  • Could not launch xampp (xampp_start.exe) after moved the xampp files to new file location [XAMPP Lite 1.7.3]ex
    • solution: execute the file: setup_xampp.bat to relocate the xampp

upgrade xampp[edit]

  • Before upgrade the xampp, remember backup the files under {xampp} and htdocs
  • re-check the installation file path of xampp in the conf files of Apache, PHP, Mysql Icon_exclaim.gif (ex: xampp was installed at d:\xampp, the conf files was written as d:d:\xampp after upgraded) [XAMPP v1.7.5]
    • apache configuration files: located {xampp}\apache\conf\*.conf
    • PHP configuration files: located {xampp}\php\php.ini
    • MySQL configuration file: located {xampp}\mysql\bin\my.ini
    • filezilla server: {xampp}\FileZillaFTP\FileZilla Server.xml (ex: the location of shared folders was required to replace D:D:\xampp with D:\xampp after upgraded)
  • Move the folder of old PHP extension files and install new one after installed new version of XAMPP. Else the folder of PHP extension files will not be overwrote during the installation. The missing PHP extension will cause Apache stop to launch.


restart the MySQL service


change the MySQL port[edit]

For AppServ or MySQL Server 5.6

  • Windows: Start -> Control Panel -> Administrative Tools -> Services -> stop the MySQL service
  • open the MySQL configuration file: Icon_exclaim.gif location of configuration file: You can check the path from Services -> MySQL service -> (Right mouse click the service name) Content -> Path to executable, and find the parameter of --defaults-file
    • For MySQL Server 5.6: x:\ProgramData\MySQL\MySQL Server 5.6\my.ini [2] Icon_exclaim.gif not the file located: x:\Program Files\MySQL\MySQL Server 5.6\my-default.ini
    • For AppServ v.2.5.10: x:\AppServ\MySQL\my.ini [3]
  • modify the MySQL configuration file
    • find this line: port=3306, and change the port what you want ex: 3307. And save the configuration file.
  • restart the MySQL service
  • (optional) If you using phpMyAdmin for MySQL management, you need to change port setting of the phpMyAdmin config file.


AppServ 修改 MySQL 的 port

  • Windows: 控制台 -> 系統管理工具 -> 服務:停用 mysql 服務
  • 修改 MySQL 設定檔,檔案位置 For AppServ v.2.5.10: x:\AppServ\MySQL\my.ini
  • 找到這一行: port=3306, 修改成你想要的 port 例如 3307,儲存設定檔
  • 控制台 -> 系統管理工具 -> 服務:啟用 mysql 服務


References[edit]

  1. php - how to access the command line for xampp on windows - Stack Overflow
  2. "x:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --defaults-file="x:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56
  3. x:\AppServ\MySQL\bin\mysqld-nt --defaults-file=x:\AppServ\MySQL\my.ini mysql