最近給電腦配置升級了下,加了一塊SSD作啓動盤,重裝了系統,結果xampp所在的目錄盤符發生了變化(D盤變成了F盤),全部的應用都沒法正常工做。這裏分享下須要手動修改的地方。php
首先打開xampp\properties.ini文件,把裏面全部的盤符都從D:修改爲F:mysql
[General] installdir=f:\xampp base_stack_name=XAMPP base_stack_version=5.6.3-0 base_stack_platform=windows require_root_privileges=1 base_user=xiao base_user_name=xiao base_mail=lingxiao1002@gmail.com hostname= [Apache] apache_server_port=80 apache_server_ssl_port=443 apache_root_directory=/xampp/apache apache_htdocs_directory=f:\xampp/htdocs apache_domainname=127.0.0.1 apache_configuration_directory=f:\xampp/apache/conf apache_unique_service_name= [MySQL] mysql_port=3306 mysql_host=localhost mysql_root_directory=f:\xampp\mysql mysql_binary_directory=f:\xampp\mysql\bin mysql_data_directory=f:\xampp\mysql\data mysql_configuration_directory=f:\xampp/mysql/bin mysql_arguments=-u root -P 3306 mysql_unique_service_name= [PHP] php_binary_directory=f:\xampp\php php_configuration_directory=f:\xampp\php php_extensions_directory=f:\xampp\php\ext
這個時候嘗試啓動,apache和tomcat依然失敗。apache失敗的緣由是由於我裝了wordpress。wordpress的配置文件沒有修改,apache啓動會報錯。因此打開xampp\apps\wordpress\conf目錄。把裏面四個配置文件的路徑所有修改一下。這樣apache就能夠正常運行了。sql
XAMPP的初始配置裏沒有tomcat,因此tomcat的運行須要單獨修改配置。由於系統重裝,JDK沒有從新安裝,只是把原來硬盤裏的JDK目錄配置到了系統path裏。tomcat啓動的時候是檢測註冊表的,因此手動建立HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit以避免報錯。shell
Tomcat的啓動腳本以下:apache
@echo off if "%OS%" == "Windows_NT" goto WinNT :Win9X echo Don't be stupid! Win9x don't know Services goto exit :WinNT echo [XAMPP]: Searching JDK HOME with reg query ... set KeyName=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit reg query "%KeyName%" /s if %ERRORLEVEL% == 1 ( echo . [XAMPP]: Cannot find current JDK installation! echo . [XAMPP]: Cannot set JAVA_HOME. Aborting ... goto :END ) set "CURRENT_DIR=%cd%" set "CATALINA_HOME=%CURRENT_DIR%" set Cmd=reg query "%KeyName%" /s for /f "tokens=2*" %%i in ('%Cmd% ^| find "JavaHome"') do set JAVA_HOME=%%j echo. echo [XAMPP]: Seems fine! echo [XAMPP]: Using %JAVA_HOME% echo. set JRE_HOME=%JAVA_HOME% echo [XAMPP]: Using JAVA_HOME=%JAVA_HOME% echo [XAMPP]: Using CATALINA_HOME=%CATALINA_HOME% echo [XAMPP]: Using JRE_HOME=%JRE_HOME% echo Installing Tomcat as an Service .\bin\service.bat install Tomcat7 goto exit :END :exit