I decided to test linkchecker before deployment to see if did the job that I needed it to do, so I deployed it on a test version of the site running on my desktop (Windows XP) via XAMP.

I was disappointed to see an AJAX error during the initial scan for links. The error message gave no clue as to the cause of the problem.

I eventually diagnosed the fact that a call to valid_url() was failing to return when it was called with a very long and complex Google Maps URL.

However a test of the call in isolation does not show the error, it which point it occurred to me that XAMP uses some flavour of PHP 5.4 and the live site runs on PHP 5.3.nn. I installed linkchecker on my staging server and the module behaved flawlessly.

I'm reporting this as a minor issue so that when PHP 5.4 becomes more prevalent and if the unexplained AJAX problem rears its ugly head there will be some record of a possible cause.

I've attached a debug backtrace of the failing call to valid_url()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Thats preg_match() behind and valid_url() should be used in many other situations, too. Do you have any nodes with PHP code? It's the most typical issue (duplicate function definitions).

rtrubshaw’s picture

I added a series of debug log statements to the valid_url function and used intermediate variables to allow me to isolate the call(s) to preg_match() and the call is logged but the statement following the call to preg_match is never executed.

There is no redefinition of preg_match as far as I can tell and an identical set-up running under PHP 5.3.nn works without a problem (and continues to do so).

This only occurs when I run on my desktop test/development environment (XAMPP) which runs some flavour of 5.4.

I tried making an isolated the call to valid_url() but this didn't cause any problems on either version of PHP.

The only idea I have at present is that something similar is happening to the PHP interpreter as when the call-time pass-by-reference warning is issued. Once issued various random classes are then subject to cannot redeclare errors. (see http://help.getpantheon.com/pantheon/topics/fatal_error_require_once_can...). I.e. at some point further up the call chain some subtle bug in 5.4 is exercised that does not mainfest itself until the call to preg_match()

As I noted orginally I don't see this as a big problem, I was just noting it for future reference as it may be "fixed" in a later release of PHP 5.4 before Drupal becomes more prevalent on it.

hass’s picture

I'm myself not sure how fast 5.4 goes into linux distributions and at very latest than, we are running in a lot of possible troubles. I have totally no clue today if we are able to workaround somehow or if this may not a linkchecker bug or not.

I have installed XAMPP with PHP 5.4 two weeks ago, but was not able make it ready for testing/repro. If this is a PHP 5.4 bug we need to close the case as it's not a bug of linkchecker itself.

rtrubshaw’s picture

If it is any help I've attached some Apache configuration files for XAMPP that I've just used to get a bare-bones D7 test site running. (You'll need to remove the .txt extensions and any underlines.)

1st - A replacement for ...\xampp\apache\conf\extras\httpd-vhosts.conf
(this assumes the creation of a new directory in the extras directory called ...\extras\vhosts.d

2nd - A new configuration file drupal7.example.com.conf that lives in ...\extras\vhosts.d

The 2nd configuration files assumes that the website source lives in:
C:\xampp\vhosts\drupal7.example.com\www
(and hence that XAMPP has been installed in C:\xampp)

The main thing is the contents of .htaccess have been added to the .conf file and the directory access stuff has been updated to the Apache 2.4 standard.

You'll also need to add the following line(s) to:
C:\windows\system32\drivers\etc\hosts
--- Lines start ---
127.0.0.1 drupal7.example.com
127.0.0.1 drupal7
--- Lines end ---

You'll need to use notepad or notepad++ (make sure that there is no extension added when the file is saved)

hass’s picture

For me Apache is just crashing and restarting if I enter <a href="http://maps.google.co.uk/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=Sense+Cymru+T%C5%B7+Penderyn+26+High+St+Merthyr+Tydfil+CF47+8DP++&amp;aq=&amp;sll=51.531045,-0.117335&amp;sspn=0.010746,0.01929&amp;dirflg=w&amp;ie=UTF8&amp;hq=Sense+Cymru+T%C5%B7+Penderyn&amp;hnear=26+High+St,+Merthyr+Tydfil+CF47,+United+Kingdom&amp;t=m&amp;ll=51.743413,-3.377845&amp;spn=0.00465,0.014741&amp;z=16" rel="nofollow">View larger map</a> into the body field and press save.

Nothing is inside php logs.

hass’s picture

hass’s picture

Category: bug » support
Status: Active » Fixed
Issue tags: +unknown

Automatically closed -- issue fixed for 2 weeks with no activity.

specky_rum’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs work

Can we reopen this? I am seeing this error on PHP 5.4.20 on Windows 7. When the link checker runs Apache crashes before it finishes. Looks like exactly the same issue as reported.

hass’s picture

Status: Needs work » Closed (fixed)

This is a bug of apache or php and not this module.

webservant316’s picture

I am seeing a related error with...

linkchecker 7.x-1.2
PHP 5.4.37
Litespeed 6.7

An AJAX HTTP error occurred. HTTP Result Code: 503 Debugging information follows. Path: /batch?id=10091&op=do StatusText: Service Unavailable ResponseText: 503 Service Unavailable 503 Service Unavailable The server is temporarily busy, try again later! Proudly powered by LiteSpeed Web ServerPlease be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.

hass’s picture

@webservant316: You may better use a webserver that is supported by Drupal. Just a hint.