最近给电脑配置升级了下,加了一块SSD做启动盘,重装了系统,结果xampp所在的目录盘符发生了变化(D盘变成了F盘),所有的应用都无法正常工作。这里分享下需要手动修改的地方。
首先打开xampp\properties.ini文件,把里面所有的盘符都从D:修改成F:
[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 [email protected] 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就可以正常运行了。
XAMPP的初始配置里没有tomcat,所以tomcat的运行需要单独修改配置。因为系统重装,JDK没有重新安装,只是把原来硬盘里的JDK目录配置到了系统path里。tomcat启动的时候是检测注册表的,所以手动创建HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit以免报错。
Tomcat的启动脚本如下:
@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
时间: 2024-10-09 10:19:45