We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

"security->hash" crash my xampp

Windows7, Xampp1.8.3(PHP v5.59)

Apache crashed running the following code.

class UserController extends \Phalcon\Mvc\Controller
{
  public function indexAction()
  {
    $this->security->hash('a');
  }
}

Following messages appeared on apache/logs/error.log:

[Fri Mar 28 18:06:41.038741 2014] [mpm_winnt:notice] [pid 16880:tid 260] AH00428: Parent: child process 12704 exited with status 3221225477 -- Restarting.

[Fri Mar 28 18:06:41.206758 2014] [mpm_winnt:notice] [pid 16880:tid 260] AH00455: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 configured -- resuming normal operations

[Fri Mar 28 18:06:41.206758 2014] [mpm_winnt:notice] [pid 16880:tid 260] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01

[Fri Mar 28 18:06:41.206758 2014] [core:notice] [pid 16880:tid 260] AH00094: Command line: 'e:\\xampp\\apache\\bin\\httpd.exe -d E:/xampp/apache'

[Fri Mar 28 18:06:41.208758 2014] [mpm_winnt:notice] [pid 16880:tid 260] AH00418: Parent: Created child process 13264

[Fri Mar 28 18:06:42.060843 2014] [mpm_winnt:notice] [pid 13264:tid 272] AH00354: Child: Starting 150 worker threads.

Please help someone.



98.9k
edited Mar '14

Could you please update to 1.3.1: https://phalcon.io/en/download



3.2k

Thanks for response. I updated to 1.3.1. But It was not solved.

Hi I have the same Issue!

I also have the issue on windows, apache, php-fpm php 5.4 vc9, open ssl, and phalcon 1.3.1. Same code seem to work on linux ... A forked version of the vokuro example and the pass generation crashes the server.



867
edited Apr '14

I also have crushed apahe on windows when using php_phalcon.dll of v.1.3.1. In the case of v.1.2.6 - all right. With v.1.3.1 calling $this->security->hash() always return false.

After update, everything is working fine :)

My apache also crashes on security->hash. xampp 1.8.2, phalcon 1.3.1, Apache/2.4.9 (Win32) OpenSSL/0.9.8y PHP/5.4.27, running on xp

[Thu Apr 24 09:47:19.748545 2014] [mpm_winnt:notice] [pid 6756:tid 196] AH00428: Parent: child process 7196 exited with status 0 -- Restarting.
[Thu Apr 24 09:47:20.029793 2014] [ssl:warn] [pid 6756:tid 196] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 24 09:47:20.123543 2014] [mpm_winnt:notice] [pid 6756:tid 196] AH00455: Apache/2.4.9 (Win32) OpenSSL/0.9.8y PHP/5.4.27 configured -- resuming normal operations
[Thu Apr 24 09:47:20.123543 2014] [mpm_winnt:notice] [pid 6756:tid 196] AH00456: Apache Lounge VC10 Server built: Mar 17 2014 11:15:11
[Thu Apr 24 09:47:20.123543 2014] [core:notice] [pid 6756:tid 196] AH00094: Command line: 'd:\\xampp\\apache\\bin\\httpd.exe -d D:/xampp/apache'
[Thu Apr 24 09:47:20.123543 2014] [mpm_winnt:notice] [pid 6756:tid 196] AH00418: Parent: Created child process 6044
[Thu Apr 24 09:47:21.076662 2014] [ssl:warn] [pid 6044:tid 1864] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 24 09:47:21.295410 2014] [ssl:warn] [pid 6044:tid 1864] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 24 09:47:21.373535 2014] [mpm_winnt:notice] [pid 6044:tid 1864] AH00354: Child: Starting 150 worker threads.

Downgrading to 1.2.6 works



19.9k

so , what if I dont want to downgrade to another version? what should I do with this crashes ?



12.1k

This is still an issue in the current version (1.3.1), any information regarding a fix in an upcoming version?



8.1k

I believe the team wants this to be fixed in the upcoming 1.3.2

In the meantime, you can try WooDzu's 'fixed' builds: https://github.com/WooDzu/cphalcon-windows

Issue on Github: https://github.com/phalcon/cphalcon/issues/2277#issuecomment-41454991



10.9k
edited Jun '14

@Phalcon : I Had an issue in WAMP where I was getting a false returned to begin with and eventually it was just crashing with a connection reset error reported by Google Chrome. I'll stick some error history at the end. Anyway, I managed to get it to hash something once I logged out and destroyed my session and just echoed out on my log in page which is open to guests. I'm using 1.3.2 locally.

My error log (including my own errors)

[Thu Jun 26 13:45:00.879609 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:00.879609 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:00.883519 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 22020 [Thu Jun 26 13:45:01.303876 2014] [mpm_winnt:notice] [pid 22020:tid 492] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:45:03.758536 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 22020 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:45:03.829899 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:45:03.829899 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:03.829899 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:03.831855 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 51268 [Thu Jun 26 13:45:04.316732 2014] [mpm_winnt:notice] [pid 51268:tid 500] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:45:29.406040 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 51268 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:45:29.461762 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:45:29.461762 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:29.461762 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:29.462740 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 21388 [Thu Jun 26 13:45:29.905582 2014] [mpm_winnt:notice] [pid 21388:tid 484] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:45:31.168611 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 21388 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:45:31.234108 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:45:31.234108 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:31.234108 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:31.235085 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 49368 [Thu Jun 26 13:45:31.712143 2014] [mpm_winnt:notice] [pid 49368:tid 484] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:45:32.994723 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 49368 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:45:33.070973 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:45:33.070973 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:33.070973 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:33.071951 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 20824 [Thu Jun 26 13:45:33.571492 2014] [mpm_winnt:notice] [pid 20824:tid 512] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:45:50.057094 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 20824 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:45:50.116726 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:45:50.117704 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:50.117704 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:50.117704 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 36360 [Thu Jun 26 13:45:50.539037 2014] [mpm_winnt:notice] [pid 36360:tid 488] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:45:51.805000 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 36360 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:45:51.880272 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:45:51.880272 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:45:51.880272 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:45:51.881250 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 21644 [Thu Jun 26 13:45:52.373947 2014] [mpm_winnt:notice] [pid 21644:tid 516] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:46:02.594813 2014] [:error] [pid 21644:tid 1704] [client 127.0.0.1:63625] PHP Notice: Undefined variable: test in C:\sites\arion\app\controllers\DashboardController.php on line 18 [Thu Jun 26 13:46:02.594813 2014] [:error] [pid 21644:tid 1704] [client 127.0.0.1:63625] PHP Stack trace: [Thu Jun 26 13:46:02.594813 2014] [:error] [pid 21644:tid 1704] [client 127.0.0.1:63625] PHP 1. {main}() C:\sites\arion\public\index.php:0 [Thu Jun 26 13:46:02.594813 2014] [:error] [pid 21644:tid 1704] [client 127.0.0.1:63625] PHP 2. Phalcon\Mvc\Application->handle() C:\sites\arion\public\index.php:34 [Thu Jun 26 13:46:02.594813 2014] [:error] [pid 21644:tid 1704] [client 127.0.0.1:63625] PHP 3. DashboardController->indexAction() C:\sites\arion\public\index.php:0 [Thu Jun 26 13:46:22.068069 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 21644 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:46:22.122815 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:46:22.122815 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:46:22.122815 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:46:22.123792 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 42084 [Thu Jun 26 13:46:22.573476 2014] [mpm_winnt:notice] [pid 42084:tid 484] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:46:23.864854 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 42084 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:46:23.940127 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:46:23.940127 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:46:23.940127 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:46:23.941105 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 3016 [Thu Jun 26 13:46:24.413275 2014] [mpm_winnt:notice] [pid 3016:tid 500] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:47:39.974879 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00428: Parent: child process 3016 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:47:40.052107 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:47:40.052107 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:47:40.052107 2014] [core:notice] [pid 38976:tid 564] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:47:40.053085 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00418: Parent: Created child process 36988 [Thu Jun 26 13:47:40.494950 2014] [mpm_winnt:notice] [pid 36988:tid 516] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:49:22.298316 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00422: Parent: Received shutdown signal -- Shutting down the server. [Thu Jun 26 13:49:24.300391 2014] [mpm_winnt:notice] [pid 36988:tid 516] AH00364: Child: All worker threads have exited. [Thu Jun 26 13:49:24.319943 2014] [mpm_winnt:notice] [pid 38976:tid 564] AH00430: Parent: Child process 36988 exited successfully. [Thu Jun 26 13:49:24.893906 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:49:24.893906 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:49:24.893906 2014] [core:notice] [pid 33916:tid 584] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:49:24.894885 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00418: Parent: Created child process 44992 [Thu Jun 26 13:49:25.266935 2014] [mpm_winnt:notice] [pid 44992:tid 496] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:49:33.023053 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00428: Parent: child process 44992 exited with status 3221225477 -- Restarting. [Thu Jun 26 13:49:33.097350 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00455: Apache/2.4.4 (Win32) PHP/5.4.16 configured -- resuming normal operations [Thu Jun 26 13:49:33.097350 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00456: Server built: Feb 23 2013 13:07:34 [Thu Jun 26 13:49:33.097350 2014] [core:notice] [pid 33916:tid 584] AH00094: Command line: 'c:\wamp\bin\apache\apache2.4.4\bin\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' [Thu Jun 26 13:49:33.098326 2014] [mpm_winnt:notice] [pid 33916:tid 584] AH00418: Parent: Created child process 11304 [Thu Jun 26 13:49:33.540190 2014] [mpm_winnt:notice] [pid 11304:tid 332] AH00354: Child: Starting 150 worker threads. [Thu Jun 26 13:49:42.443126 2014] [:error] [pid 11304:tid 1708] [client 127.0.0.1:63847] PHP Notice: Undefined variable: test in C:\sites\arion\app\controllers\DashboardController.php on line 18 [Thu Jun 26 13:49:42.443126 2014] [:error] [pid 11304:tid 1708] [client 127.0.0.1:63847] PHP Stack trace: [Thu Jun 26 13:49:42.444104 2014] [:error] [pid 11304:tid 1708] [client 127.0.0.1:63847] PHP 1. {main}() C:\sites\arion\public\index.php:0 [Thu Jun 26 13:49:42.444104 2014] [:error] [pid 11304:tid 1708] [client 127.0.0.1:63847] PHP 2. Phalcon\Mvc\Application->handle() C:\sites\arion\public\index.php:34 [Thu Jun 26 13:49:42.444104 2014] [:error] [pid 11304:tid 1708] [client 127.0.0.1:63847] PHP 3. DashboardController->indexAction() C:\sites\arion\public\index.php:0



10.9k

But now I can't get it to work even if I have destoyed my session.



10.9k

I think I'm going to have to use PHP's password_hash() in version 5.5 instead. https://www.php.net/manual/en/function.password-hash.php

It's not solved by 1.3.2 and i'm waiting for this problem to be solved in 1.3.3 but i dunno when it'll be released . as i and many others are using windows system for our development environment , this bug is a serious problem , i did create some hashes in a linux box and put them in my database as a workaround in order to continue my app in windows , i just hope phalcon devs solve it soon .



26.3k

I have the same problem as you described @Darkc0d3r while developing on windows. I have made a workaround like described here https://forum.phalcon.io/discussion/2709/how-to-bypass-current-bug-with-security-hash-on-windows-

How your workaround works?

i have multiple virtual box for my development purpose , i setup a LAMP server and installed phalcon on an ubuntu box , then created some hashesh using

$this->security->hash('whatever string');

then i copied those hashesh to my windows box database , since checkhash method works fine in windows so that was my simple workaround to continue my work, it may seems stupid but worked for me for the time being and of course i will be happy if phalcon devs release 1.3.3 with the problem fixed