Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.94 KB | None | 0 0
  1. Cannot log in to the MySQL server
  2.  
  3. UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE user='root';
  4.  
  5. <?php
  6.  
  7. $configurationFile = '../wampmanager.conf';
  8. $templateFile = '../wampmanager.tpl';
  9. $wampserverIniFile = '../wampmanager.ini';
  10. $langDir = '../lang/';
  11. $aliasDir = '../alias/';
  12. $modulesDir = 'modules/';
  13. $logDir = 'logs/';
  14. $wampBinConfFiles = 'wampserver.conf';
  15. $phpConfFileForApache = 'phpForApache.ini';
  16.  
  17. // on charge la conf locale
  18. $wampConf = @parse_ini_file($configurationFile);
  19.  
  20. //on renseigne les variables du template avec la conf locale
  21. $c_installDir = $wampConf['installDir'];
  22. $c_wampVersion = $wampConf['wampserverVersion'];
  23. $c_navigator = $wampConf['navigator'];
  24. $c_editor = $wampConf['editor'];
  25.  
  26. //Variable suppressLocalhost based on urlAddLocalhost
  27. $c_suppressLocalhost = true;
  28. if(isset($wampConf['urlAddLocalhost']) && $wampConf['urlAddLocalhost'] != "off")
  29. $c_suppressLocalhost = false;
  30.  
  31. //Ajout variables pour les ports
  32. $c_DefaultPort = "80";
  33. $c_UsedPort = isset($wampConf['apachePortUsed']) ? $wampConf['apachePortUsed'] : '';
  34. $c_DefaultMysqlPort = "3306";
  35. $c_UsedMysqlPort = isset($wampConf['mysqlPortUsed']) ? $wampConf['mysqlPortUsed'] : '';
  36.  
  37. $c_apacheService = $wampConf['ServiceApache'];
  38. $c_mysqlService = $wampConf['ServiceMysql'];
  39.  
  40. $c_phpCliVersion = $wampConf['phpCliVersion'];
  41. $c_mysqlVersion = $wampConf['mysqlVersion'];
  42. $c_mysqlServiceInstallParams = $wampConf['mysqlServiceInstallParams'];
  43. $c_mysqlServiceRemoveParams = $wampConf['mysqlServiceRemoveParams'];
  44. $c_apacheServiceInstallParams = $wampConf['apacheServiceInstallParams'];
  45. $c_apacheServiceRemoveParams = $wampConf['apacheServiceRemoveParams'];
  46. $c_webgrind = "webGrind";
  47.  
  48.  
  49. // on construit les variables correspondant aux chemins
  50. $c_apacheVersionDir = $wampConf['installDir'].'/bin/apache';
  51. $c_phpVersionDir = $wampConf['installDir'].'/bin/php';
  52. $c_mysqlVersionDir = $wampConf['installDir'].'/bin/mysql';
  53. $c_apacheConfFile = $c_apacheVersionDir.'/apache'.$wampConf['apacheVersion'].'/'.$wampConf['apacheConfDir'].'/'.$wampConf['apacheConfFile'];
  54. $c_apacheVhostConfFile = $c_apacheVersionDir.'/apache'.$wampConf['apacheVersion'].'/'.$wampConf['apacheConfDir'].'/extra/httpd-vhosts.conf';
  55. $c_apacheAutoIndexConfFile = $c_apacheVersionDir.'/apache'.$wampConf['apacheVersion'].'/'.$wampConf['apacheConfDir'].'/extra/httpd-autoindex.conf';
  56. $c_apacheExe = $c_apacheVersionDir.'/apache'.$wampConf['apacheVersion'].'/'.$wampConf['apacheExeDir'].'/'.$wampConf['apacheExeFile'];
  57. $c_phpConfFile = $c_apacheVersionDir.'/apache'.$wampConf['apacheVersion'].'/'.$wampConf['apacheExeDir'].'/'.$wampConf['phpConfFile'];
  58. $c_phpCliConfFile = $c_phpVersionDir.'/php'.$c_phpCliVersion.'/'.$wampConf['phpConfFile'];
  59. $c_mysqlExe = $c_mysqlVersionDir.'/mysql'.$wampConf['mysqlVersion'].'/'.$wampConf['mysqlExeDir'].'/'.$wampConf['mysqlExeFile'];
  60. $c_mysqlConfFile = $c_mysqlVersionDir.'/mysql'.$wampConf['mysqlVersion'].'/'.$wampConf['mysqlConfDir'].'/'.$wampConf['mysqlConfFile'];
  61. $c_phpExe = $c_phpVersionDir.'/php'.$c_phpCliVersion.'/'.$wampConf['phpExeFile'];
  62. $c_phpCli = $c_phpVersionDir.'/php'.$c_phpCliVersion.'/'.$wampConf['phpCliFile'];
  63. $c_mysqlConsole = $c_mysqlVersionDir.'/mysql'.$c_mysqlVersion.'/'.$wampConf['mysqlExeDir'].'/mysql.exe';
  64.  
  65. //Test du fichier hosts
  66. $c_hostsFile = getenv('WINDIR').'system32driversetchosts';
  67. $c_hostsFile_writable = true;
  68. if(file_exists($c_hostsFile)) {
  69. if(!is_file($c_hostsFile))
  70. error_log($c_hostsFile." is not a file");
  71. if(!is_writable($c_hostsFile)) {
  72. if(chmod($c_hostsFile, 0644) === false)
  73. error_log("Impossible to modify the file ".$c_hostsFile." to be writable");
  74. if(!is_writable($c_hostsFile)) {
  75. error_log("The file ".$c_hostsFile." is not writable");
  76. $c_hostsFile_writable = false;
  77. }
  78. }
  79. }
  80. else {
  81. error_log("The file ".$c_hostsFile." does not exists");
  82. $c_hostsFile_writable = false;
  83. }
  84.  
  85. $phpExtDir = $c_phpVersionDir.'/php'.$wampConf['phpVersion'].'/ext/';
  86. $helpFile = $c_installDir.'/help/wamp5.chm';
  87. $wwwDir = $c_installDir.'/www';
  88.  
  89. //dll to create symbolic links from php to apache/bin
  90. // 55 & 56 for PHP 7
  91. $icu = array(
  92. 'number' => array('56', '55', '54', '53', '52', '51', '50', '49'),
  93. 'name' => array('icudt', 'icuin', 'icuio', 'icule', 'iculx', 'icutest', 'icutu', 'icuuc'),
  94. );
  95. $php_icu_dll = array();
  96. foreach($icu['number'] as $icu_number) {
  97. foreach($icu['name'] as $icu_name) {
  98. $php_icu_dll[] = $icu_name.$icu_number.".dll";
  99. }
  100. }
  101.  
  102. $phpDllToCopy = array_merge(
  103. $php_icu_dll,
  104. array (
  105. 'libeay32.dll',
  106. 'libsasl.dll',
  107. 'libpq.dll',
  108. 'libssh2.dll', //For php 5.5.17
  109. 'php5isapi.dll',
  110. 'php5nsapi.dll',
  111. 'ssleay32.dll',
  112. 'php5ts.dll',
  113. 'php7ts.dll', //For PHP 7
  114. )
  115. );
  116.  
  117. $phpParams = array (
  118. 'allow url fopen'=>'allow_url_fopen',
  119. 'allow url include' => 'allow_url_include',
  120. 'allowc call time pass reference'=>'allow_call_time_pass_reference',
  121. 'asp tags'=>'asp_tags',
  122. 'auto globals jit' => 'auto_globals_jit',
  123. 'date.timezone' => 'date.timezone',
  124. 'default_charset' => 'default_charset',
  125. 'display errors'=>'display_errors',
  126. 'display startup errors'=>'display_startup_errors',
  127. 'enable dl'=>'enable_dl',
  128. 'expose PHP'=>'expose_php',
  129. 'file uploads'=>'file_uploads',
  130. 'ignore repeated errors'=>'ignore_repeated_errors',
  131. 'ignore repeated source'=>'ignore_repeated_source',
  132. 'implicit flush'=>'implicit_flush',
  133. 'log errors' => 'log_errors',
  134. 'magic quotes gpc'=>'magic_quotes_gpc',
  135. 'magic quotes runtime'=>'magic_quotes_runtime',
  136. 'magic quotes sybase'=>'magic_quotes_sybase',
  137. 'memory_limit'=>'memory_limit',
  138. 'output_buffering' => 'output_buffering',
  139. 'post_max_size'=>'post_max_size',
  140. 'register argc argv'=>'register_argc_argv',
  141. 'register globals'=>'register_globals',
  142. 'register long arrays'=>'register_long_arrays',
  143. 'report memleaks'=>'report_memleaks',
  144. 'safe mode'=>'safe_mode',
  145. 'short open tag' => 'short_open_tag',
  146. 'track errors'=>'track_errors',
  147. 'upload_max_filesize'=>'upload_max_filesize',
  148. 'y2k compliance'=>'y2k_compliance',
  149. 'ze1 compatibility mode'=>'zend.ze1_compatibility_mode',
  150. 'zend.enable_gc' => 'zend.enable_gc',
  151. 'intl.default_locale' => 'intl.default_locale',
  152. 'zlib output compression'=>'zlib.output_compression',
  153. '(XDebug) : Profiler Enable Trigger' => 'xdebug.profiler_enable_trigger',
  154. '(XDebug) : Profiler' => 'xdebug.profiler_enable',
  155. '(XDebug) : Remote debug' => 'xdebug.remote_enable',
  156. );
  157.  
  158. // Adding parameters to WampServer modifiable
  159. // by "Settings" sub-menu on right-click Wampmanager icon
  160. $wamp_Param = array(
  161. 'VirtualHostSubMenu',
  162. 'ProjectSubMenu',
  163. 'HomepageAtStartup',
  164. 'MenuItemOnline',
  165. 'ItemServicesNames',
  166. 'urlAddLocalhost',
  167. );
  168.  
  169. // Extensions can not be loaded by extension =
  170. // for example zend_extension
  171. $phpNotLoadExt = array(
  172. 'php_opcache',
  173. );
  174.  
  175. // Apache modules which should not be disabled
  176. $apacheModNotDisable = array(
  177. 'authz_core_module',
  178. 'php5_module',
  179. 'php7_module',
  180. );
  181.  
  182. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement