简体   繁体   English

XAMPP 控制面板配置文件在哪里?

[英]Where is the XAMPP control panel config file?

I'm creating an installer batch file which automatically installs XAMPP and configures Apache.我正在创建一个安装程序批处理文件,它会自动安装 XAMPP 并配置 Apache。 Altough, this installer should launch the Apache server automatically when the system starts up.尽管如此,这个安装程序应该会在系统启动时自动启动 Apache 服务器。

My idea is that the batch file should use mklink to put XAMPP into the Windows startup folder, since in XAMPP you can configure to start Apache automatically.我的想法是批处理文件应该使用mklink将 XAMPP 放入 Windows 启动文件夹中,因为在 XAMPP 中您可以配置为自动启动 Apache。 The problem is that I have to configure it in a config file as the installer batch file can't access it in another way.问题是我必须在配置文件中配置它,因为安装程序批处理文件无法以其他方式访问它。

I searched for this config file in the whole xampp folder but couldn't find it.我在整个 xampp 文件夹中搜索了这个配置文件,但找不到它。 I also tried linking the apache_start.bat file directly inside the startup folder, but that just gave me an error.我还尝试将apache_start.bat文件直接链接到启动文件夹中,但这只是给了我一个错误。

Here's my whole german batch file:这是我的整个德语批处理文件:

@ECHO off
CHCP 65001
SETLOCAL
TITLE Montemanager - Automatische Installation
:INTRO
ECHO ###### Montemanager - Automatische Installation #####
ECHO # ------------------------------------------------- #
ECHO #   Vielen Dank, dass Sie sich für Montemanager     #
ECHO #  entschieden haben. Diese Anwendung wird nun eine #
ECHO #       automatische Installation durchführen.      #
ECHO #                  Das bedeutet:               #
ECHO # ------------------------------------------------- #
ECHO #    1. Es werden alle erforderlichen Komponente    #
ECHO #  auf diesem System installiert. ACHTUNG:     #
ECHO #  Dieses Programm darf nur auf dem Server     #
ECHO #  ausgeführt werden!                      #
ECHO #    2. Ihre Lizenz des Montemanager wird aktiviert #
ECHO #      und der zuständige Server gestartet.        #
ECHO # ------------------------------------------------- #
ECHO #      Mehr Information finden Sie auf:        #
ECHO #   www.montemanager.de/help?page=installer    #
ECHO #####################################################
PAUSE
:PROMPT
SET /P AREYOUSURE=Hiermit wird die automatische Installation ausgeführt. Dies kann einige Zeit in Anspruch nehmen. Es werden ca. 0 MB Speicherplatz sowie eine Internetverbindung benötigt. Möchten Sie fortfahren? (j/n) 
IF /I "%AREYOUSURE%" NEQ "j" GOTO ABORT
ECHO Dateien verschieben...
IF EXIST \montemanager RMDIR \montemanager /s /q
MOVE /y montemanager \montemanager
CD montemanager/setup/dependencies
GOTO DOWNLOAD
:DOWNLOAD
ECHO Herunterladen von XAMPP...
CURL -o xampp.exe https://www.apachefriends.org/xampp-files/7.4.3/xampp-windows-x64-7.4.3-0-VC15-installer.exe --ssl-no-revoke --location
IF %ERRORLEVEL% NEQ 0 GOTO NETWORK_ERROR
ECHO Fertig. Bitte drücken Sie eine Taste, sobald die Anwendung installiert ist.
START xampp.exe
PAUSE
CD \xampp\php
PHP \montemanager\setup\apache_config\index.php
IF %ERRORLEVEL% NEQ 0 GOTO INTERNAL_ERROR
:STARTUP
CD \montemanager\setup\apache_config\
SET "admins="
SET "prev="
FOR /f "delims=" %%A IN ('net localgroup administrators') DO (
 CALL SET "admins=%%admins%% %%prev%%"
 SET "prev=%%A"
)
SET admins=%admins:*- =%
ECHO Nun müssen Sie Administratorrechte angeben.
PAUSE
RUNAS startup.bat /user %admins%
PAUSE
:END
ECHO Die Installation der Serverkomponente ist abgeschlossen.
PAUSE
CD \xampp
START apache_start.bat
START mysql_start.bat
START "" https://localhost/setup/manager.php
EXIT
:ABORT
ECHO Abgebrochen.
PAUSE
EXIT
:NETWORK_ERROR
ECHO Es ist ein Netzwerkfehler aufgetreten. Bitte überprüfen Sie Ihre Internetverbindung.
PAUSE
EXIT
:INTERNAL_ERROR
SET /P %DIAGNOSTIC% Es ist ein interner Fehler aufgetreten. Soll eine automatische Überprüfung durchgeführt werden? (j/n) 
IF /I "%DIAGNOSTIC%" NEQ "j" GOTO ABORT
ECHO Das Programm versucht nun, die Anwendung XAMPP zu öffnen.
PAUSE
XAMPP
SET /P %XAMPP% Wurde XAMPP erfolgreich gestartet? (j/n) 
IF /I "%XAMPP%" NEQ "j" GOTO XAMPP_ERROR
ECHO Teste PHP Client...
CD \xampp\php
PHP \montemanager\apache_config\test.php
SET /P %PHP% Wurde "Funktioniert." ausgegeben? (j/n) 
IF /I "%PHP%" NEQ "j" GOTO XAMPP_ERROR
ECHO Anscheinend ist die heruntergeladene Lizenz ungültig oder wurde falsch heruntergeladen. Bitte kontaktieren Sie den Support: support@montemanager.de
PAUSE
EXIT
:XAMPP_ERROR
ECHO Das Programm wurde nicht richtig installiert. Bitte schließen Sie dieses Fenster und führen Sie die Installation erneut durch.
PAUSE
EXIT

PS: If you are wondering why I'm using PHP: In order to modify the config file, I had to use php since apparently, cmd doesn't have any file manipulation commands. PS:如果您想知道我为什么使用 PHP:为了修改配置文件,我不得不使用 php,因为显然 cmd 没有任何文件操作命令。

感谢@PaulF,我解决了!

C:\\xampp\\xampp-control.ini

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM