0
votes

XAMPP installation (Apache, MySQL, PHP, Perl) is crashing every other time I call a DOTNET object through PHP. For instance the sample code on php.net

<?php
  $stack = new DOTNET("mscorlib", "System.Collections.Stack");
  $stack->Push(".Net");
  $stack->Push("Hello ");
  echo $stack->Pop() . $stack->Pop();
  //$stack = NULL; tried this, with no luck
?>

This will display Hello .Net the first time, but if I refresh the page Apache crashes and immediately restarts. If I refresh again, I see Hello .Net. If I refresh again, you guessed it; Apache crashes....any ideas? Maybe I should be releasing the object somehow?

Thanks

Apache Log:

[Wed Feb 29 00:59:44 2012] [notice] Apache/2.2.21 (Win32) SVN/1.6.6 DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Feb 29 00:59:44 2012] [notice] Server built: Sep 10 2011 11:34:11
[Wed Feb 29 00:59:44 2012] [notice] Parent: Created child process 5156
[Wed Feb 29 00:59:45 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 29 00:59:45 2012] [notice] Digest: done
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Child process is running
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Acquired the start mutex.
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Starting 150 worker threads.
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Starting thread to listen on port 443.
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Starting thread to listen on port 443.
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Starting thread to listen on port 80.
[Wed Feb 29 00:59:46 2012] [notice] Child 5156: Starting thread to listen on port 80.
[Wed Feb 29 00:59:49 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Wed Feb 29 00:59:50 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 29 00:59:50 2012] [notice] Digest: done
[Wed Feb 29 00:59:51 2012] [notice] Apache/2.2.21 (Win32) SVN/1.6.6 DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Feb 29 00:59:51 2012] [notice] Server built: Sep 10 2011 11:34:11
[Wed Feb 29 00:59:51 2012] [notice] Parent: Created child process 5948
[Wed Feb 29 00:59:51 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 29 00:59:51 2012] [notice] Digest: done
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Child process is running
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Acquired the start mutex.
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Starting 150 worker threads.
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Starting thread to listen on port 443.
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Starting thread to listen on port 80.
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Starting thread to listen on port 80.
[Wed Feb 29 00:59:52 2012] [notice] Child 5948: Starting thread to listen on port 443.
[Wed Feb 29 00:59:55 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Wed Feb 29 00:59:55 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 29 00:59:55 2012] [notice] Digest: done
[Wed Feb 29 00:59:57 2012] [notice] Apache/2.2.21 (Win32) SVN/1.6.6 DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Feb 29 00:59:57 2012] [notice] Server built: Sep 10 2011 11:34:11
[Wed Feb 29 00:59:57 2012] [notice] Parent: Created child process 4596
[Wed Feb 29 00:59:58 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 29 00:59:58 2012] [notice] Digest: done
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Child process is running
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Acquired the start mutex.
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Starting 150 worker threads.
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Starting thread to listen on port 443.
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Starting thread to listen on port 80.
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Starting thread to listen on port 443.
[Wed Feb 29 00:59:59 2012] [notice] Child 4596: Starting thread to listen on port 80.

This shows a few reboots.

1
What is the php version?Brad Christie
I can't replicate the crash though i'm not using XAMPP. Is your apache log saying anything?rwilliams
I'm running PHP 5.3.8, Apache 2.2.21Mike L.
Does executing it directly through php return the same issue? i.e. Command prompt: php.exe /path/to/file.phpBrad Christie

1 Answers

1
votes

file could be

$stack = new DOTNET("mscorlib", "System.Collections.Stack");
$stack->Push(".Net");

create a file with your commands, instead of calling directly use below call

$output = exec("php dotnet.php"); 

echo $output;