Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When my script runs the 4th line below in WP 2.9.2, its causing my web app to throw an "Apache HTTP Service has stopped working" error

$cat=get_cat_ID('top-menu');
$catHidden=get_cat_ID('hidden');
$myqueryCurrent = new WP_Query();
$myqueryCurrent->query(array('cat'=>"$cat,-$catHidden",'post__not_in'=>get_option('sticky_posts')));

Do you see something in that 4th line that's incompatible with WP 2.9.2? The code runs fine on the same server under WP 3.0.4

Here's the details of the error:

Problem signature: Problem Event Name: APPCRASH Application Name: httpd.exe Application Version: 2.2.14.0 Application Timestamp: 4aeb9704 Fault Module Name: php5ts.dll Fault Module Version: 5.3.1.0

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Executing the code you posted results in a crash inside the PHP module. I assume you're running PHP as module inside apache on windows, if the module crashes, apache crashes as well.

Ensure that you're using the right PHP modules here. Are you sure you need the Thread-Safe variant of PHP for apache? Those are reported to not run stable under windows IIRC.

So this might not be related to the wordpress version but to the server configuration.

Hope this answer helps a bit tackling things down.

share|improve this answer
    
I'm running xampplite on windows 7 laptop. How can I configure it to more closely emulate say, hostgator or bluehost's default Apache/PHP setups? I'm trying to code locally and emulate final hosting conditions as much as possible. –  Scott B Feb 9 '11 at 18:54
    
@Scott B: By running Linux on your computer e.g. in a virtual environment. Turnkey is for an easy start. There is a LAMP Stack Appliance - Web Stack (MySQL) and even WordPress Appliance which are ready to run with VirtualBox on windows for example. –  hakre Feb 9 '11 at 19:36

Realise this old now, but this may help people finding this via Google:

I had problems with Apache dying when running similar code within a function called by the pre_get_posts hook. Problem was I missed the conditional:

$query->is_main_query()

meaning it was doing work for all the queries, not just the main one. Adding that fixed the problem for me. The full conditional I use is (then other code above below that:

if ( ! is_category() || ! $query->is_main_query() || ! is_a( $query, 'WP_Query' ) )
    return;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.