Problem with 1.2.1
I updated phalcon to version 1.2.1 and my app stop working. It shows no error, browser (Chrome) says "This webpage is not available" with the error Error code: ERR_CONNECTION_RESET.
App is multimodule. If I remove multi-module part then it works fine. So it seems the problem with Module class.
I tried on Windows, PHP 5.4.13 and FreeBSD 6.3, PHP 5.5.1
Can you try compiling again from master?
Unfortunately, no. Only on Windows.
Could you please give us the code that causes the crash?
$application->registerModules(
array(
'frontend' => array(
'className' => 'Frontend\Module',
'path' => __DIR__.'/sites/frontend/Module.php',
)
)
);
And there is standart Module class in Module.php file with registerAutoloaders() and registerServices() methods. If I remove class definition from Module.php then it shows error "Module wasn't found in the dependency injection container."
namespace Frontend;
class Module implements \Phalcon\Mvc\ModuleDefinitionInterface
{
/**
* Register a specific autoloader for the module
*/
public function registerAutoloaders()
{
$loader = new \Phalcon\Loader();
$loader->registerNamespaces(
array(
'Frontend\Controllers'=>__DIR__.'/controllers/',
'Frontend\Library'=>__DIR__.'/libraries/',
)
);
$loader->register();
}
/**
* Register specific services for the module
*/
public function registerServices($di)
{
//Registering a dispatcher
$di->set('dispatcher', function() {
$dispatcher = new \Phalcon\Mvc\Dispatcher();
$dispatcher->setDefaultNamespace("Frontend\Controllers");
return $dispatcher;
});
$di->getShared('view')->setViewsDir(__DIR__.'/views/');
/**
* Elements
*/
$di->set('elements', function(){
return new Library\Elements;
});
}
}
OK, this is the code I have: https://gist.github.com/sjinks/6076720
I run it: php index.php
This is what is displayed:
Frontend\Module::registerAutoloaders
Frontend\Module::registerServices
Frontend\Controllers\IndexController::indexAction
No crashes etc.
Could you please check whether my code works for you? If it works, then I still need the code to reproduce the bug.
I found the problem. It was because of small error. If error occurs in controller or if write something like echo 'test'; exit; in controller, app crashes instead of showing error or stoping. Any guess why it does?
I can confirm this. exit; or die; inside controller crashes the Apache on windows with Phalcon 1.2.1.
Apache log entry
[Thu Jul 25 16:05:17.354466 2013] [mpm_winnt:notice] [pid 3836:tid 200] AH00428: Parent: child process 4252 exited with status 3221225477 -- Restarting.
If you run it from the console, does it show something like
php: cphalcon/ext/phalcon.c:685: zm_shutdown_phalcon: Assertion `(((zend_phalcon_globals *) (*((void ***) tsrm_ls))[((phalcon_globals_id)-1)])->start_memory) == ((void *)0)' failed.
:question:
I fixed this in master yesterday, DLLs are now available
Yes, with new DLL it's Ok
It's ok. But there's another problem with session. It cause the crash with no error. Should I create another issue about it?
Yes please and try to offer as much information possible so that we can address it :)
On Thu, Jul 25, 2013 at 3:25 PM, Timur Bakarov [email protected]:
It's ok. But there's another problem with session. It cause the crash with no error. Should I create another issue about it?
— Reply to this email directly or view it on GitHubhttps://github.com/phalcon/cphalcon/issues/909#issuecomment-21578308 .