Page 1 of 1

Apache/PHP Clobbered XP-Pro

Posted: Thu Nov 25, 2004 1:12 pm
by MadCoder
I wanted to be able to test PHP pages at home before uploading to our Church website. So, I installed the following:

Apache 1.3.33 (win32 x86) using the installer (running in a console window NOT as a service)
PHP 4.3.9 (win32) using the manual process (using the Apache module NOT command line)

on: Windows XP Pro ver 2002 SP1 (P3 400MHz w/ 320 Meg RAM)

I moved htdocs to a second disk drive with more space (where I do my development).

I had everything working with only one problem that I will save for later (couldn't play wma files in Windows Media Player object).

I extracted the PHP manual (all 4000+ pages) into a subdir of the htdocs location and began going through the manual using the server. As I did this, I would copy and paste some of the code snippets into a test page which I also accessed through the server.

After a couple of hours, I decided to take a break. I left the server running for several hours. When I returned to see if I could fix the wma problem, I found that the display was completely scrambled (looked like a hardware sync problem). I ended up rebooting and the display would not come back at all (stayed blank eventhough windows was at the longin screen). I tried a different monitor, same problem. I was able to boot in safe mode and everything looked fine. Ran scandisk, etc. No success. Eventually, I had to use the System Restore to get my display back. The system is now running fine, but of course the Apache and PHP installs were removed.

My first thought was that a memory leak had crept into the monitor memory. But that should not be persistent across a reboot (especially since Apache is NOT running as a service). Having to use the System Restore would seem to indicate that some driver or dll file was damaged.

The only run-time problem that was significant was when I tried to execute the code from the Ticks function:

Code: Select all

<?php
// A function that records the time when it is called
function profile($dump = FALSE)
&#123;
    static $profile;

    // Return the times stored in profile, then erase it
    if ($dump) &#123;
        $temp = $profile;
        unset($profile);
        return($temp);
    &#125;

    $profile&#1111;] = microtime();
&#125;

// Set up a tick handler
register_tick_function("profile");

// Initialize the function before the declare block
profile();

// Run a block of code, throw a tick every 2nd statement
declare(ticks=2) &#123;
    for ($x = 1; $x < 50; ++$x) &#123;
        echo similar_text(md5($x), md5($x*$x)), "<br />;";
    &#125;
&#125;

// Display the data stored in the profiler
print_r(profile(TRUE));
?>
This caused the Windows fatal error dialog which wanted to send a report to Microsoft. It reported that Apache was causing a fatal error (OK, I didn't really read it, I just clicked on "Don't Send"). But I continued working for at least another hour before I took my break.

Has anyone seen anything like this before? I want to get this working but I can't afford to have this machine down or acting strangely. I use it to produce CD's for the church.

Any help would be greatly appreciated.

Posted: Mon Nov 29, 2004 5:30 pm
by rehfeld
i could never use ticks and declare etc on win....

it crashed apache everytime(although the parent apache process would just spawn a new child, but it doesnt matter. it still crashed and wouldnt work).

php5 apache2 xp pro....

it acted normally until you tried to use ticks though correct? stay away from ticks...

Posted: Mon Nov 29, 2004 10:13 pm
by MadCoder
Yeah, that's pretty much what I decided. I reloaded everthing, and created another system restore savepoint (just in case). It has been working fine, and I think I will just stay away from ticks.

Thanks