[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[网络工具] APMA快速搭php环境

无聊写了个APMA下载地址,能够快速搭建php环境,比如可以在几秒内,在你的电脑中搭建出一个discuz论坛, Adminer和phpinfo界面经过美化,效果蛮棒。adminer仿phpmyadmin色,但是速度和性能远超phpmyadmin。php7.几兼容性不好,已删去。
具体搭配 Apache2.4.18 + Php5.6.17  +MySQL5.5.20 + Adminer4.2.3
核心使用批处理胶水语言,为了简洁美观,纯英文写了。星线内容可自定义端口、启动类型,以及完全用批处理实现的服务器管理界面。
  1. @echo off&title APMA Server
  2. mode con cols=45 lines=11
  3. setlocal enabledelayedexpansion
  4. color 0f
  5. ::***************************************
  6. ::Startup type: auto, demand
  7. set ApacheST=demand
  8. set MySQLST=demand
  9. ::***************************************
  10. ::Setting Apache port
  11. set port=80
  12. ::***************************************
  13. :pre
  14. echo APMA control panel
  15. echo   ______________________________
  16. echo  丨Apache(  )   丨MySQL (  )   丨
  17. echo  丨  7.Re/Start 丨  8.Re/Start 丨9.All Start
  18. echo  丨  4.Shut     丨  5.Shut     丨6.All Shut
  19. echo  丨  1.Monitor  丨  2.Password 丨3.Home
  20. echo  丨_____________丨_____________丨0.Uninstall
  21. echo Input:
  22. PUSHD ".\apache"
  23. if not exist .\install.lock (goto install)
  24. :main
  25. net start|findstr /i /c:"Apache_APMA" 1>nul 2>nul && set "buff=√" || set "buff=×"
  26. net start|findstr /i /c:"MySQL_APMA" 1>nul 2>nul && set "buf=√" || set "buf=×"
  27. cls
  28. echo APMA control panel
  29. echo   ______________________________
  30. echo  丨Apache(!buff!)   丨MySQL (!buf!)   丨
  31. echo  丨  7.Re/Start 丨  8.Re/Start 丨9.All Start
  32. echo  丨  4.Shut     丨  5.Shut     丨6.All Shut
  33. echo  丨  1.Monitor  丨  2.Password 丨3.Home
  34. echo  丨_____________丨_____________丨0.Uninstall
  35. set "cho="
  36. set /p cho=Input:
  37. echo Waitting...
  38. if "!cho!"=="" goto main
  39. if "!cho!"=="2" goto resetpass
  40. if /i "!cho!"=="0" goto uninstall
  41. goto APMA!cho!
  42. exit
  43. :APMA1
  44. start .\bin\ApacheMonitor.exe
  45. goto main
  46. :APMA3
  47. start http://127.0.0.1:!port!
  48. goto main
  49. :APMA4
  50. net stop Apache_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  51. goto main
  52. :APMA5
  53. net stop MySQL_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  54. goto main
  55. :APMA6
  56. net stop Apache_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  57. net stop MySQL_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  58. goto main
  59. :APMA7
  60. net stop Apache_APMA 1>nul 2>nul
  61. net start Apache_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  62. goto main
  63. :APMA8
  64. net stop MySQL_APMA 1>nul 2>nul
  65. net start MySQL_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  66. goto main
  67. :APMA9
  68. net start Apache_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  69. net start MySQL_APMA 1>nul 2>nul && echo ------Succeed------ || echo ------Failed------
  70. goto main
  71. :resetpass
  72. net stop MySQL_APMA 1>nul 2>nul
  73. cls
  74. echo   ______________________________
  75. echo  ^|                              ^|
  76. echo    ###  Reset MySQL password
  77. echo  ^|______________________________^|.
  78. set "passnew="
  79. set /p passnew=-^> New password:
  80. CD "..\mysql\bin"
  81. start .\mysqld.exe --skip-grant-tables
  82. :authen
  83. echo use mysql;>.\temp.ini
  84. echo update user set %string%=password("!passnew!") where user="root";>>.\temp.ini
  85. echo flush privileges;>>.\temp.ini
  86. echo quit>>.\temp.ini
  87. mysql<.\temp.ini 1>nul 2>nul|| set string=authentication_string && goto authen
  88. del .\temp.ini
  89. mysqladmin.exe shutdown -uroot -p"!passnew!" 1>nul 2>nul|| echo Reset password failed && pause>nul && exit
  90. CD "..\..\apache"
  91. goto main
  92. :install
  93. sc query "Apache_APMA" 1>nul 2>nul && echo Service "Apache_APMA" already exists && pause>nul && exit
  94. cls
  95. echo   ______________________________
  96. echo  ^|                              ^|
  97. echo    ###  Install APMA
  98. echo  ^|______________________________^|.
  99. echo  Check port...
  100. netstat -ano|find "0.0.0.0:!port! " 1>nul 2>nul && echo  Apache port is occupied, please release or modify the port && pause>nul && exit
  101. netstat -ano|find "0.0.0.0:3306 " 1>nul 2>nul && echo  MySQL default port is occupied, please try again after the release port && pause>nul && exit
  102. CD ".\conf\"
  103. rename .\httpd.conf temp.conf
  104. echo Listen !port!>.\httpd.conf
  105. findstr /i /v "^listen.*[0-9]*$" <.\temp.conf>>.\httpd.conf
  106. del .\temp.conf
  107. CD "..\"
  108. set er=0
  109. .\bin\httpd.exe -k install -n Apache_APMA
  110. net start Apache_APMA 1>nul 2>nul || set er=1
  111. CD "..\mysql"
  112. .\bin\mysqld.exe --install MySQL_APMA --defaults-file="%CD%\my.ini"
  113. net start MySQL_APMA 1>nul 2>nul || set er=1
  114. if !er! equ 1 (echo Service failed to start & pause>nul & exit)
  115. sc config Apache_APMA start= !ApacheST! 1>nul 2>nul
  116. sc config MySQL_APMA start= !MySQLST! 1>nul 2>nul
  117. CD "..\apache"
  118. echo.>.\install.lock
  119. goto main
  120. :uninstall
  121. cls
  122. echo   ______________________________
  123. echo  ^|                              ^|
  124. echo    ###  Uninstall APMA
  125. echo  ^|______________________________^|.
  126. net stop Apache_APMA 1>nul 2>nul
  127. .\bin\httpd.exe -k uninstall -n Apache_APMA
  128. net stop MySQL_APMA 1>nul 2>nul
  129. ..\mysql\bin\mysqld.exe --remove MySQL_APMA
  130. del .\install.lock
  131. exit
复制代码
1

评分人数

回复 2# codegay
还有什么芒果云,非常好用php云,h芒果云
用芒果云写代码非常棒的感觉。

TOP

擦,玩这么多东西。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

返回列表