PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 28, 2014 5:49 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: WAMP, can't get errors
PostPosted: Tue Aug 18, 2009 4:39 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
Hello all,

I'm trying to run a WAMP (Windows, Apache, MySQL, PHP) server from my computer for developing a site.

I got Apache up and running and I've successfully installed PHP, but it's not working completely as I expected.

I tried a regular page with just phpinfo() and it works fine in Google Chrome.

My first problem:

Internet Explorer and chrome seem to try to load the page twice for some reason, and after the phpinfo comes up for a brief fraction of a second, it switches to a "could not load" the site error page. Firefox does this as well. What's going on?

My second problem:

In php.ini I set:
error_reporting = E_ALL | E_STRICT
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 0 (I've also tried setting this to 1024)
error_log = (Path to my work folder)\php_errors.log

I've run this with php files that have no errors and they load up fine. Whenever I'm trying to load a php file I'm developing however, it fails!

In Google chrome I'm told that the connection resets, in IE the webpage cannot be loaded, and I can't remember what Firefox says. Not only does it not show any errors, the error log file I specified remains empty!


Not sure what to do I looked around and I realized I had yet to check my apache log to see what's going on:
Here's what I've observed:

Trying to load up a phpinfo file (in IE):
apache's access.log reports:
127.0.0.1 - - [18/Aug/2009:17:24:21 -0400] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524
127.0.0.1 - - [18/Aug/2009:17:24:21 -0400] "GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2146
(This ends up with generic "Internet Explorer cannot display the webpage." Why are there two requests?)

apache's error.log reports:
[Tue Aug 18 17:24:22 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting.
httpd.exe: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.xxx for ServerName
[Tue Aug 18 17:24:22 2009] [notice] Apache/2.2.13 (Win32) PHP/5.3.0 configured -- resuming normal operations

and proceeds with some regular "created child process," "child process is running," "acquired start mutex," "starting 64 worker threads," etc.

same unchanged php info file (in Google Chrome):
apache's access.log reports:
127.0.0.1 - - [18/Aug/2009:17:26:56 -0400] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524
127.0.0.1 - - [18/Aug/2009:17:26:56 -0400] "GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2146

apache's error.log reports:
[Tue Aug 18 17:26:56 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting.
httpd.exe: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.xxx for ServerName
[Tue Aug 18 17:26:56 2009] [notice] Apache/2.2.13 (Win32) PHP/5.3.0 configured -- resuming normal operations


If you guys could tell me what's wrong with this stuff I'll fix it and try it again with a php file that has an intentional error in it and see if that works too.

Thanks for any help guys!


EDIT:
I made it sound like only IE sends two http requests, but chrome does as well.


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 4:42 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Feb 15, 2009 8:22 pm
Posts: 2119
Location: Ipswich, UK
I've had this before - it seems that if you get into an infinite loop with recursion, apache will just give up and restart...and obviously that resets the connection.

Are you getting into infinite loops at all? :D

And with IE requesting the page twice...I don't know, it could be something similar to the firefox bug. Basically, it requests the page twice if you don't specify a charset.


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 4:53 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
@jackpf:

No infinite recursion: The only php on the test page is the following line
<?php phpinfo(); ?>

How would I go about setting a charset? Maybe that'll fix some of my problems?

Also it's worth noting that the page loads fine in Google Chrome and it appears to request the page twice as well.


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 4:56 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
Sorry to double post!

I just realized something with the google chrome loading of the page:

I went to view the source of what google chrome was loading and I scrolled all the way to the bottom. The very last line that was loaded was:

<tr><td class="e">ignore_user_abort</td><td class="v">

It appears to me that Google chrome also loses the connection halfway through loading the phpinfo page, but it just leaves whatever it got so far instead of switching to a generic error page.

Any other ideas?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 6:02 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Feb 15, 2009 8:22 pm
Posts: 2119
Location: Ipswich, UK
Hmm....that's mighty strange.

Is it just pages with phpinfo(), or all pages?

For example, if you put:
Syntax: [ Download ] [ Hide ]
echo 'hello';
what happens?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 6:39 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
@jackpf

echo 'hello' works.

I started thinking that it only happens when php sends back alot of information.

I then made an echo function that sends back over 300kb of information, expecting it to fail partway through.

No such luck though, the entire page loaded.

Any other ideas?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 7:37 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Feb 15, 2009 8:22 pm
Posts: 2119
Location: Ipswich, UK
It seems to be stalling on getting the ini setting for ignore_user_abort then, since that's where the output stops.

What happens with this:
Syntax: [ Download ] [ Hide ]
var_dump(ini_get('ignore_user_abort'));



Also, what's the ini setting for ignore_user_abort in your php.ini file?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 8:09 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
string(1) "0"

Ok. I'm guessing that means that it's a string of length 1 containing only "0" (which I'm guessing means "off").

I just checked through the php.ini file and it is not set anywhere. There is a line that sets it but is commented out.

I'm not too sure that this is the issue simply because I only sampled the output from google chrome only once.

Notice the above quote from the access.log:
127.0.0.1 - - [18/Aug/2009:17:24:21 -0400] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524
127.0.0.1 - - [18/Aug/2009:17:24:21 -0400] "GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2146
127.0.0.1 - - [18/Aug/2009:17:26:56 -0400] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524
127.0.0.1 - - [18/Aug/2009:17:26:56 -0400] "GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2146

Correct me if I'm wrong but I believe the last number in the log entries is the number of bytes that were sent. For whatever reason there is a discrepancy of 378 bytes. I believe that it may be that it flushes the data periodically but as soon as php fails the connection gets reset. The difference in the number of bytes sent I believe can only be attributed to other processes running on my computer making php take longer to complete its operations.

Any other ideas?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 8:14 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
I just checked... I think the last number is just the size of the cache that sent the data or something, because I changed the size of the PHP file (by adding some static text) and it gave the same sizes. So just ignore my guesses above.


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 8:37 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Feb 15, 2009 8:22 pm
Posts: 2119
Location: Ipswich, UK
Ooooh, that url request is for the image at the top of the phpinfo() page I do believe.

So yeah, your browser will request the page, then request the image. Hence two requests to the same(ish) url.

As for the lack of output...I have no idea to be perfectly honest. Is it only phpinfo()? If so...is it really that big a deal?

I know that's very trivial and unhelpful of me...but I'm out of ideas. Have you tried reinstalling apache & php?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 8:57 pm 
Offline
DevNet Master
User avatar

Joined: Fri Jan 18, 2008 1:36 am
Posts: 3549
Location: Israel, ME
You're encountering segmentation faults, which plague the 2.2 line of apache. Something is probably causing this, but the source could be hard to track (for this reason I stayed on 2.0 for a long time).
Check the following:
- what modules are activated for apache? (especially mod_deflate)
- did you make any changes from the default configuration to the document root <directory> directive? perhaps added custom rewrite rules
- do you have an .htaccess file setting additional directives to the directory the stores the file causing the faults?
You might consider reinstalling apache or even downgrading to the latest 2.0 version.


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 9:35 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
@jackpf

As I mentioned in my first post, I think these problems are a symptom of a greater problem that's ultimately causing the error messages to fail to be displayed or logged. Without error messages I don't think I'd be able to develop or debug my solutions.

@pytrin

Maybe it's just me but I feel kinda unsafe going back versions. Aren't there lots of security vulnerabilities and performance issues fixed in the newer versions?

However for a development machine I don't think it really matters. I'll try to go back to the last build of Apache 2.0 then. Will I need to get an older version of PHP?


Top
 Profile  
 
PostPosted: Tue Aug 18, 2009 9:58 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Feb 15, 2009 8:22 pm
Posts: 2119
Location: Ipswich, UK
Wow...I've never even heard of apache 2.2 segmentation faults. 8O

Nice one.


Top
 Profile  
 
PostPosted: Wed Aug 19, 2009 3:24 am 
Offline
DevNet Master
User avatar

Joined: Fri Jan 18, 2008 1:36 am
Posts: 3549
Location: Israel, ME
Quote:
However for a development machine I don't think it really matters. I'll try to go back to the last build of Apache 2.0 then. Will I need to get an older version of PHP?


This does not affect PHP in any way. The 2.0 line is still being supported for security fixes, so that is not a concern either (2.2 has some new features etc). In fact, as surprising as it sounds, many hosting providers are still running apache 1.3 as its considered very stable precisely to avoid the problems you are encountering right now.


Top
 Profile  
 
PostPosted: Wed Aug 19, 2009 12:02 pm 
Offline
Forum Newbie

Joined: Tue Aug 18, 2009 4:06 pm
Posts: 12
That is surprising.

I've downloaded and installed Apache 2.0.63 with openssl and will test it shortly.

I have another question.

I think I downloaded the thread safe PHP. Is there a difference? and when should I use which?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group