Server issue Import template fails using Apache on Windows

sonnb

Well-known member
I am not sure if there is a workaround for this but ideally it should be stated in the documentation.

I am using Windows as development environment. When I try to upgrade/rebuild master data, XF is not able to import all the templates, it will stop at the 29th template.

It fails in this part:
PHP:
$dw->bulkSet(array(
                    'style_id' => 0,
                    'title' => $templateName,
                    'template' => XenForo_Helper_DevelopmentXml::processSimpleXmlCdata($template),
                    'addon_id' => $addOnId,
                    'version_id' => (int)$template['version_id'],
                    'version_string' => (string)$template['version_string']
                ));
Apache will be crashed and automatically restarted.
[Wed Sep 02 15:42:10.282221 2015] [mpm_winnt:notice] [pid 7740:tid 628] AH00428: Parent: child process 5836 exited with status 3221225725 -- Restarting.
[Wed Sep 02 15:42:10.676484 2015] [mpm_winnt:notice] [pid 7740:tid 628] AH00455: Apache/2.4.7 (Win32) OpenSSL/0.9.8y PHP/5.4.22 configured -- resuming normal operations
[Wed Sep 02 15:42:10.676484 2015] [mpm_winnt:notice] [pid 7740:tid 628] AH00456: Apache Lounge VC10 Server built: Nov 26 2013 16:07:35
[Wed Sep 02 15:42:10.676484 2015] [core:notice] [pid 7740:tid 628] AH00094: Command line: 'D:\\xampp\\apache\\bin\\httpd.exe -d D:/xampp/apache'
[Wed Sep 02 15:42:10.678485 2015] [mpm_winnt:notice] [pid 7740:tid 628] AH00418: Parent: Created child process 9992
AH00548: NameVirtualHost has no effect and will be removed in the next release D:/xampp/apache/conf/extra/httpd-vhosts.conf:19
[Wed Sep 02 15:42:11.595243 2015] [mpm_winnt:notice] [pid 9992:tid 552] AH00354: Child: Starting 150 worker threads.

I searched the web and found the issue is because of the "long regular expressions in PHP" which is because of this part:
PHP:
public static function processSimpleXmlCdata($cdata)
    {
        return str_replace(']-]->', ']]>', strval($cdata));
    }

This could be solved by increasing ThreadStackSize by adding following line to httpd.conf
Code:
<IfModule mpm_winnt_module>
   ThreadStackSize 8000000
</IfModule>

There is also a bug report regarding this Apache exit code: PHP :: Bug #29107 :: Parent: child process exited with status 3221225725

If there is no workaround, I hope it could be mentioned in the Documentation of XF.
 
That's not a regular expression though.

I would note that plenty of people use Windows and Apache for development without issues. There may be specific configurations you need to make if you're using an uncommon setup though (mpm_winnt isn't something I've ever seen used).
 
I use XAMPP with default configuration. It also happens when I upgrade the addon's xml - sometime the templates are not being updated. I think it is helpful in case someone face the same issue. Thanks for your patient.
 
This might be what @Jake B experiences with the blank templates which don't get compiled. In the cases I've seen so far, the common link has been XAMPP.

FWIW - I never had a good time with WAMP or XAMPP. I used Zend Server for around a year. They gave away a free 1 year dev license to users of their previous (no longer available) free community edition. In recent months, I began to use Bitnami stacks:

WAMP Stack Cloud Hosting, WAMP Stack Hosting - Installers and VM
MAMP Stack Cloud Hosting, MAMP Stack Hosting - Installers and VM

Actually in recent weeks I've been running a stack through a pre-configured Ubuntu box on Vagrant. Files are shared between host and guest machine using NFS which is a doddle to set up with Vagrant (though does need a plugin for Windows support).
 
This might be what @Jake B experiences with the blank templates which don't get compiled. In the cases I've seen so far, the common link has been XAMPP.
That is the case. I used to get blank templates while was trying to upgrade add-ons with big XML files. Thanks for your information about Stack.
 
OMG I tried this it helped me! I am using Windows Server 2008 Dual Xeon Quad Core 30GB Ram. Would like to state I had the issue with Wamp then switched to XAMPP same issue!

So far since I added the coding @sonnb suggested to my httpd.conf the issue seems to have went away but will not truly know until I have updated a few more addons...

Code:
<IfModule mpm_winnt_module>
   ThreadStackSize 8000000
</IfModule>
 
OMG I tried this it helped me! I am using Windows Server 2008 Dual Xeon Quad Core 30GB Ram. Would like to state I had the issue with Wamp then switched to XAMPP same issue!

So far since I added the coding @sonnb suggested to my httpd.conf the issue seems to have went away but will not truly know until I have updated a few more addons...

Code:
<IfModule mpm_winnt_module>
   ThreadStackSize 8000000
</IfModule>
I am happy to see it works for you. It is the most annoying issue which kept happening for a long time until I post this thread.
 
Yep, so far I have updated several known addons that caused the white screens in options and all have been compiled properly! On another note it seems a lot of peeps were recommend I switch to another host because of this and I just want to say I host my own server at a local Data center and I love challenges but I also love short cuts and this was one that most likely saved me from alienating myself from xenForo!
 
Top Bottom