Could someone point me to a list of all the different memory/time/[whatever] limits that can be imposed by PHP? In short, Apache gives me a -103 (ERR_CONNECTION_ABORTED) error when merely instantiating an object with certain parameters. I experienced this first on Rackspace's Cloud Sites platform, and then on my local Windows box. I've yet to see the problem show up on one of Rackspace's CentOS cloud servers.
Other details:
- The request goes on for about 4 seconds before it dies.
- The memory usage for the httpd process jumps from ~15M to ~30M during the request.
ini_get('memory_limit')returns 264M.ini_get('max_execution_time')return 60.- PHP version is 5.4.7.
- Apache version is 2.4.3.
- Underlying PHP application is Lemonstand.
Basically, I'm creating a new instance of the Shop_CustomerGroup class which inherits from Db_ActiveRecord. The code dies when the constructor of Db_ActiveRecord tries to create a new instance of Phpr_Validation.
<?php
class Db_ActiveRecord extends Db_SqlBase implements IteratorAggregate
{
// More code...
public function __construct($values = null, $options = array())
{
$this->modelState = self::stateCreating;
$this->model_options = $options;
$this->implement = Phpr_Util::splat($this->implement, true);
array_unshift($this->implement, 'Phpr_Events');
parent::__construct();
$this->initialize();
self::$object_counter++;
$this->objectId = 'ac_obj_'.self::$object_counter;
if (!$this->get_model_option('no_validation'))
{
if (!empty($options['test'])) {
// If I pass in `null`, 'foo' gets thrown. But if I pass in `$this`, the script appears to die.
$this->validation = new Phpr_Validation($this, 'test');
} else {
$this->validation = new Phpr_Validation($this);
}
$this->validation->focusPrefix = get_class($this)."_";
}
// Fill with data
if ($values !== null)
{
$this->fill($values);
$this->fill_relations($values);
}
$this->modelState = self::stateCreated;
}
// More code...
}
class Phpr_Validation
{
// More code...
public function __construct( $Owner = null, $FormId = 'FormElement' )
{
if ($FormId == 'test')
throw new Phpr_ApplicationException('foo');
$this->_owner = $Owner;
$this->_formId = $FormId;
$this->_fields = array();
$this->errorFields = array();
$this->valid = false;
$this->errorMessage = null;
$this->fieldErrors = array();
$this->fieldValues = array();
}
// More code...
}
Unless there's something special about passing $this into an object's constructor, I'm convinced I'm running into some kind of limit. I just don't know what that limit might be.
Any help is appreciated! Thanks!
Update 1:
Request URL:
https://[DOMAIN_NAME]/checkout/new_account
Request Headers
POST https://[DOMAIN_NAME]/checkout/new_account HTTP/1.1
Pragma: no-cache
Origin: [DOMAIN_NAME]
PHPR-EVENT-HANDLER: ev{onHandleRequest}
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
PHPR-POSTBACK: 1
Referer: https://[DOMAIN_NAME]/checkout/new_account
X-Requested-With: XMLHttpRequest
PHPR-REMOTE-EVENT: 1
Apache Config
<VirtualHost [IP_ADDRESS]:443>
ServerAdmin postmaster@[DOMAIN_NAME]
DocumentRoot "[PATH...]"
ServerName [DOMAIN_NAME]
SSLEngine on
SSLCertificateFile "conf/ssl.crt/[DOMAIN_NAME].crt"
SSLCertificateKeyFile "conf/ssl.key/[DOMAIN_NAME].key"
<Directory "[PATH...]">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/[DOMAIN_NAME]-ssl-error.log"
</VirtualHost>
Update 2:
xampp\apache\logs\error.log
- [Mon May 06 18:44:49.119268 2013] [ssl:warn] [pid 8820:tid 396] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
- [Mon May 06 18:44:49.159268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
- [Mon May 06 18:44:49.159268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00456: Server built: Aug 18 2012 12:41:37
- [Mon May 06 18:44:49.159268 2013] [core:notice] [pid 8820:tid 396] AH00094: Command line: 'C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
- [Mon May 06 18:44:49.160268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00418: Parent: Created child process 15352
- [Mon May 06 18:44:50.017268 2013] [ssl:warn] [pid 15352:tid 272] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
- [Mon May 06 18:44:50.057268 2013] [mpm_winnt:notice] [pid 15352:tid 272] AH00354: Child: Starting 150 worker threads.
- [Mon May 06 18:45:43.777268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00428: Parent: child process exited with status 255 -- Restarting.
- [Mon May 06 18:45:44.154268 2013] [ssl:warn] [pid 8820:tid 396] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
- [Mon May 06 18:45:44.193268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
- [Mon May 06 18:45:44.193268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00456: Server built: Aug 18 2012 12:41:37
- [Mon May 06 18:45:44.193268 2013] [core:notice] [pid 8820:tid 396] AH00094: Command line: 'C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
- [Mon May 06 18:45:44.194268 2013] [mpm_winnt:notice] [pid 8820:tid 396] AH00418: Parent: Created child process 12524
- [Mon May 06 18:45:45.018268 2013] [ssl:warn] [pid 12524:tid 272] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
- [Mon May 06 18:45:45.056268 2013] [mpm_winnt:notice] [pid 12524:tid 272] AH00354: Child: Starting 150 worker threads.
xampp\apache\logs[DOMAIN_NAME]-ssl-error.log
- [Mon May 06 18:44:48.777268 2013] [ssl:warn] [pid 8820:tid 396] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
- [Mon May 06 18:44:49.119268 2013] [ssl:warn] [pid 8820:tid 396] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
- [Mon May 06 18:44:49.683268 2013] [ssl:warn] [pid 15352:tid 272] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
- [Mon May 06 18:44:50.018268 2013] [ssl:warn] [pid 15352:tid 272] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
- [Mon May 06 18:45:44.154268 2013] [ssl:warn] [pid 8820:tid 396] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
- [Mon May 06 18:45:44.680268 2013] [ssl:warn] [pid 12524:tid 272] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
- [Mon May 06 18:45:45.018268 2013] [ssl:warn] [pid 12524:tid 272] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
Update 3 Apache error in Event Viewer
Faulting application name: httpd.exe, version: 2.4.3.0, time stamp: 0x502f70a3
Faulting module name: php5ts.dll, version: 5.4.7.0, time stamp: 0x505114f8
Exception code: 0xc0000005
Fault offset: 0x0005d719
Faulting process id: 0x24f8
Faulting application start time: 0x01ce4b5683b7a39a
Faulting application path: C:\xampp\apache\bin\httpd.exe
Faulting module path: C:\xampp\php\php5ts.dll
Report Id: f646e88a-b749-11e2-9017-005056c00008
display_errorsdoesn't catch the issue in time. - Niels Keurentjesini_get('error_reporting')returns 32767 (same asE_ALL),ini_get('display_errors')returns 1, andini_get('log_errors')also returns 1. - Stephen Bunch