Page 1 of 2

xampp 7 portable

PostPosted: 24. December 2015 05:39
by thjbd
when i run xampp-control.exe i get
"10:28:19 AM [main] Initializing Control Panel
10:28:19 AM [main] Windows Version: Windows 7 Ultimate SP1 64-bit
10:28:19 AM [main] XAMPP Version: 7.0.0
10:28:19 AM [main] Control Panel Version: 3.2.2 [ Compiled: Nov 12th 2015 ]
10:28:19 AM [main] Running with Administrator rights - good!
10:28:19 AM [main] XAMPP Installation Directory: "d:\xampp7\"
10:28:19 AM [main] Checking for prerequisites
10:28:19 AM [main] All prerequisites found
10:28:19 AM [main] Initializing Modules
10:28:19 AM [main] The FileZilla module is disabled
10:28:19 AM [main] The Mercury module is disabled
10:28:19 AM [main] Starting Check-Timer
10:28:19 AM [main] Control Panel Ready
10:28:25 AM [Apache] Attempting to start Apache app...
10:28:25 AM [Apache] Status change detected: running
10:28:26 AM [Apache] Status change detected: stopped
10:28:26 AM [Apache] Error: Apache shutdown unexpectedly.
10:28:26 AM [Apache] This may be due to a blocked port, missing dependencies,
10:28:26 AM [Apache] improper privileges, a crash, or a shutdown by another method.
10:28:26 AM [Apache] Press the Logs button to view error logs and check
10:28:26 AM [Apache] the Windows Event Viewer for more clues
10:28:26 AM [Apache] If you need more help, copy and post this
10:28:26 AM [Apache] entire log window on the forums
"
and if i run setup_xampp.bat i get
"Fatal error: Uncaught Error: Call to undefined function eregi_replace() in D:\xampp7\install\install.php:34
Stack trace:
#0 {main}
thrown in D:\xampp7\install\install.php on line 34
Press any key to continue . . ."

what is the mistake i am making?
there is nothing in apache,php error log!
currently i have another portable xampp 5.6.14 but i am turning off properly 5.6.14 before running 7.

Re: xampp 7 portable

PostPosted: 24. December 2015 12:15
by Nobbie
I think this a bug in the setup_xampp.bat script, because it calls the PHP Script install.php, which contains a call to the function "eregi_replace()". This function has been removed from PHP7. You should write a bug report to Bitnami, they probably overlooked that one.

Re: xampp 7 portable

PostPosted: 24. December 2015 13:02
by Altrea
I have reported that issue to the XAMPP developers.
The old eregi functions are removed in PHP 7 so they need to be replaced by the preg_ functions

Re: xampp 7 portable

PostPosted: 26. December 2015 19:42
by Joergi
The file install/install.php is full of removed functions. Not only eregi_... functions, but also the ereg_... calls need to be converted to preg_... calls. These are only the ones, which I spotted quickly - there may be more fatal errors in there.

These bugs, which break the installation routines, basically make XAMPP 7.0.0 unusable.

Re: xampp 7 portable

PostPosted: 26. December 2015 23:03
by Nobbie
Joergi wrote:These bugs, which break the installation routines, basically make XAMPP 7.0.0 unusable.


This is nonsense, i never used setup_xampp.bat for my many many many many Xampp installations. Only if you need to run setup_xampp.bat, it collides with the missing PHP functions. Anyway, it is a job of 3 minutes to replace the eregi_XXXXX functions by preg_XXXXX functions. For someone who is working with Xampp and "needs" PHP7, it should be very easy to convert install.php to PHP7.

Re: xampp 7 portable

PostPosted: 26. December 2015 23:26
by Joergi
Nobbie wrote:This is nonsense, i never used setup_xampp.bat for my many many many many Xampp installations. Only if you need to run setup_xampp.bat, it collides with the missing PHP functions.


Right, setup_xampp.bat only does not work, when you try to use it. :wink:

No, joking apart: At least with the ZIP package and the 7z package you just don't have the right paths in the configuration files, if you don't run setup_xampp.bat. Without this broken script, at least the ZIP and 7z packages are unusable. (I have not checked other packages, but if I had to guess, I would say that the installer exe runs this script as well.)

Re: xampp 7 portable

PostPosted: 26. December 2015 23:37
by Nobbie
Joergi wrote:Without this broken script, at least the ZIP and 7z packages are unusable.


As i said, i installed Xampp many many many times and it always installs flawlessly. And still, it is very easy to replace eregi_xxxx by preg_xxxx.

Joergi wrote:I have not checked other packages, but if I had to guess, I would say that the installer exe runs this script as well.)


And how to you explain the first topic here, that someone successfully has installed Xampp 7 (but later on Apache failed to start in xampp-control.exe)?

Re: xampp 7 portable

PostPosted: 26. December 2015 23:51
by Joergi
Nobbie wrote:As i said, i installed Xampp many many many times and it always installs flawlessly.


Yes, for me prior versions installed fine as well. 7.0.0 doesn't.

Nobbie wrote:And how to you explain the first topic here, that someone successfully has installed Xampp 7 (but later on Apache failed to start in xampp-control.exe)?


I do not know, what other people do. Maybe these people did not follow the installation instructions. This would also explain why they had a broken system further down the road. Or maybe they by chance had one of the few usecases, in which running this script is not necessary. However, I do not have such a usecase. I need to run the script and the script is broken.

Re: xampp 7 portable

PostPosted: 27. December 2015 00:18
by Altrea
All zipped versions works very well without executing setup_xampp.bat if extracted in the root directory (at path C:\xampp\, D:\xampp\, etc.)
I am not sure (because not tested), but the installer version should have exactly the same problem. If i remember correctly it uses the setup_xampp.bat script too at the end of the installation process to set the paths.

Re: xampp 7 portable

PostPosted: 27. December 2015 11:33
by Nobbie
Altrea wrote: If i remember correctly it uses the setup_xampp.bat script too at the end of the installation process to set the paths.


I just downloaded Xampp7 on a Windows machine, started the installer, everything installs fine, no error message, nothing went wrong, finally i started Apache and MySQL successfully and last not least i started a browser and localhost showed up "Welcome to Xampp for Windows 7.0.0.".

@Joergi: what is meant by "unusable" and what am i doing wrong?

I also checked install.php and there are the still the invalid eregi_xxxx calls, so my download is not fixed, but it it installs flawlessly and FAR FROM unusable.

Re: xampp 7 portable

PostPosted: 27. December 2015 12:19
by Nobbie
For those, who needs to run setup_xampp.bat, here is a fix:

a) proceed to c:/xampp (or where you have installed xampp), changedir into "install" directory

b) edit the file install.php

c) on the first line of install.php you will see the PHP open tag "<?php". Copy & paste the following code under this open tag (click "SELECT ALL" and then Ctrl.+C to copy the full code):

Code: Select all
   function eregi_replace($pattern, $replacement, $subject) {
      $preg_pattern = '~'.$pattern.'~i';
      return preg_replace($preg_pattern, $replacement, $subject);
   }

   function ereg_replace($pattern, $replacement, $subject) {
      $preg_pattern = '~'.$pattern.'~';
      return preg_replace($preg_pattern, $replacement, $subject);
   }

   function eregi($pattern, $subject) {
      $preg_pattern = '~'.$pattern.'~i';
      return preg_match($preg_pattern, $subject);
   }


d) save install.php and try to run setup_xampp.bat

Re: xampp 7 portable

PostPosted: 27. December 2015 14:23
by Joergi
Altrea wrote:[...]the installer version should have exactly the same problem. If i remember correctly it uses the setup_xampp.bat script too at the end of the installation process to set the paths.


I have not tested that as well, but it would only be logical, if for the same task it used the same code.

Re: xampp 7 portable

PostPosted: 27. December 2015 14:28
by Joergi
Thanks for posting this workaround. I got my install working by adjusting the new configuration according to the configuration files, which I had used for an older version of XAMPP.

Nobbie wrote:@Joergi: what is meant by "unusable" and what am i doing wrong?


Try installing XAMPP in any folder, which is not directly in the root of a drive. The result is that, without updating the configuration files, wrong paths are in your config. This makes the servers crash during startup.

Re: xampp 7 portable

PostPosted: 28. December 2015 09:42
by Nobbie
Joergi wrote:
Altrea wrote:[...]the installer version should have exactly the same problem. If i remember correctly it uses the setup_xampp.bat script too at the end of the installation process to set the paths.


I have not tested that as well, but it would only be logical, if for the same task it used the same code.


I have tested that and your suggestion is WRONG. It is NOT called.

Re: xampp 7 portable

PostPosted: 28. December 2015 09:48
by Nobbie
Joergi wrote:Try installing XAMPP in any folder, which is not directly in the root of a drive. The result is that, without updating the configuration files, wrong paths are in your config. This makes the servers crash during startup.


Simply install it to the recommended folder c:/xampp and it is perfectly usable. It is your problem only and not a totally "unusable" Xampp. The default installations (as well .exe as .gzip) are working perfectly out of the box.