Paintball guns - Apply for Credit Card - Insurance Quotes - Web Hosting - Debt Consolidation

PDA

View Full Version : Google search quits on OS X.2 w/WebSTAR5.3


mduke
Mar 4th 2004, 3:03 pm
On OS X.2, WebSTAR 5.3 (server), DigitalPoint's Google search results page, which worked fine out of the box, suddenly quit (no results). My server logs show the same error results that I get on an alternative setup on (2) Unix/Apache searching the same site (the WebSTAR server). BTW, Unix php.ini had error reporting on so I could see the errors in browser.

I doubt the numerous errors that appear at both sites are related to the OS X site no longer yielding results (AFAIK, these errors are not unusual and when I disable them on Unix, the search results work fine). I supply both URLs (search for something like "salmon" or "trout"), and the error code from my WebSTAR log, which is the same as the errors I got on Unix (this because I need to shut off error checking to at least temporarily have working search engine via remote site before I can resolve this on OS X):

http://fish.washington.edu/search
http://depts.washington.edu/safs/search

I'm open to any suggestions. I suspect it's something to do with my OS X php.ini.

Marcus Duke
Webmaster/Info Specialist
UW Aquatic & Fishery Sciences

And here are the errs:

PHP Notice: Undefined index: start in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 26
PHP Notice: Undefined variable: line in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 34
PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php(38) : eval()'d code on line 2
PHP Parse error: parse error, unexpected $ in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php(38) : eval()'d code on line 44
PHP Notice: Use of undefined constant end - assumed 'end' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Undefined variable: urls in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Use of undefined constant start - assumed 'start' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Undefined variable: urls in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Use of undefined constant results - assumed 'results' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Use of undefined constant end - assumed 'end' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Undefined variable: urls in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 45
PHP Notice: Use of undefined constant results - assumed 'results' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 58
PHP Notice: Use of undefined constant results - assumed 'results' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 63
PHP Notice: Use of undefined constant start - assumed 'start' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 69
PHP Notice: Undefined index: start in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 69
PHP Notice: Use of undefined constant error - assumed 'error' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 70
PHP Notice: Undefined index: error in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 70
PHP Notice: Use of undefined constant urls - assumed 'urls' in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 74
PHP Warning: Invalid argument supplied for foreach() in /Applications/4DWebSTAR/WebServer/DefaultSite/search/results.php on line 74

digitalpoint
Mar 4th 2004, 3:12 pm
Checked the search.digitalpoint.com server to make sure it's giving proper results, and it does seem to be okay as far as the server goes.

You can see if it's a connection problem between your server and search.digitalpoint.com, by editing your results.php file. Simply remove the "@" from the beginning of the fopen() statement. The "@" suppresses any errors it might have (they are suppressed by default so end users don't see your Google API key, since that's within the URL).

If that shows no errors, add the following:

echo $line;
exit;

after the following line: fclose($handle);That will echo to the browser what it's getting from search.digitalpoint.com instead of trying to evaluate it.

Let me know what you find...

- Shawn

mduke
Mar 5th 2004, 10:32 am
Thanks, Shawn: I think I made some progress: (1) I got no errors from removing @, and (2) the "echo $line; exit;" string yielded plain text in the results part of the page (and also printed out the header (logo, title)). The search results for "salmon" are below. It seems to be working but just not formatting it (although why the original script said "no results," I dunno). I hope this yields some clues as to what needs to be fixed. I will try to leave the search pages as is for this morning, but soon I will have to redirect the search link to the Unix server, for now, if I can't fix this on the OS X server. Thanks for your help! Marcus

BTW, in case, the URL is http://fish.washington.edu/search

Search Results
array ( \'urls\' => array ( 0 => \'http://www.fish.washington.edu/hatchery/salmon.html\', 1 => \'http://www.fish.washington.edu/sic/resources/\', 2 => \'http://www.fish.washington.edu/sic/\', 3 => \'http://www.fish.washington.edu/research/alaska/alaskapdf.html\', 4 => \'http://www.fish.washington.edu/research/alaska/images/facilities/aerial_chignik.html\', 5 => \'http://www.fish.washington.edu/research/alaska/pix_maps.html\', 6 => \'http://www.fish.washington.edu/research/alaska/images/scenic_wildlife/scenic_sockupstream.html\', 7 => \'http://www.fish.washington.edu/research/alaska/forecasts.html\', 8 => \'http://www.fish.washington.edu/research/highseas/\', 9 => \'http://steelhead.fish.washington.edu/~parker/gallery/salmon\', ), \'titles\' => array ( 0 => \'Salmon Life Cycle\', 1 => \'Salmon in the Classroom—Educational Resources\', 2 => \'Salmon in the Classroom—Homepage\', 3 => \'Alaska Salmon Program Reports—PDF Files\', 4 => \'Alaska Salmon Program—Aerial of Chignik camp and village\', 5 => \'Alaska Salmon Program—Maps\', 6 => \'Alaska Salmon Program—Upstream migration\', 7 => \'Alaska Salmon Program—Bristol Bay sockeye forecasts\', 8 => \'High Seas Salmon Program Homepage\', 9 => \'Parker's Photo Gallery :: Salmon\', ), \'snippet\' => array ( 0 => \'Salmon Life Cycle. Eggs. Emergence. Fresh Water Rearing. Estuary Rearing. Ocean Migration. Ocean Growth. Spawning Migration. Spawning. \', 1 => \'... Salmon Resources. These links provide general information about salmon as well as other endangered species in the Pacific Northwest. ...\', 2 => \'Funding and support for the Salmon in the Classroom Program provided by agencies outside UW remains uncertain at this late date. ...\', 3 => \'Alaska Salmon Program Technical Reports. ... Acrobat Reader is available at no cost at http://www.adobe.com. Alaska Salmon Program Home. Rep. #. Title. PDF. ...\', 4 => \'Photo by G. Ruggerone. Aerial view of Chignik Lake with the program field camp in the foreground and Chignik Village in the background. ...\', 5 => \'... Alaska; Chignik Lake system; Iliamna Lake; Wood River Lakes system. Photo Gallery Home | Alaska Salmon Program Home. Last updated 8/29/01. \', 6 => \'Photo by A. Wolfe. Sockeye salmon migrating up a shallow stream. ...\', 7 => \'Bristol Bay Sockeye Salmon Run & Catch Forecasts. ... Rep. #. Title. PDF. 2008. Forecast of the 2001 Run of Sockeye Salmon to Bristol Bay. 2008.pdf. 9910. ...\', 8 => \'The High Seas Salmon Research Program at the School of Aquatic and Fishery Sciences (SAFS), University of Washington, is a continuation of North Pacific ...\', 9 => \'Salmon. ... A pair of Buoy 10 kings Viewed: 28 times. A Salmon Bay King Viewed: 34 times. A Lewis River spring king. Viewed: 29 times. ...\', ), \'results\' => \'720\', \'start\' => \'1\', \'end\' => \'10\', )

digitalpoint
Mar 5th 2004, 10:41 am
Okay, so it *is* getting results, so that's a good thing. :) For whatever reason your PHP setup seems to be adding backslashes to the results though. Without being able to test different configs on your server, it's hard to say... might be something to do with magic quotes within the php.ini or something.

A work around that I can think of off the top of my head would be to edit the results.php file like so:

Change:


eval ('$urls = ' . $line . ';');


to:


eval ('$urls = ' . stripslashes($line) . ';');


Let me know if that helps...

- Shawn

mduke
Mar 5th 2004, 11:15 am
Boyo, you done made my day, wot! That did the trick (I had to remove the echo $line; exit; code first, of course). The site's working fine now. Thank you so much! So you think it might be the magic quotes in the php.ini, eh? I'll look into this. I'm pretty sure I would'na done anything with those settings because I use them w/Dreamweaver MX 2004 (only been doing PHP sites for 1 years, still consider myself a beginner).

If you have any suggestions on the ini, I'm all ears. Otherwise, I'll consider this case "closed." Thanks again.

digitalpoint
Mar 5th 2004, 11:18 am
Truthfully, I don't know... PHP has so many configuration options I often forget what does what (usually I leave everything as default).

What you might want to do (since you have a machine it does work properly on) is run a simple PHP script that shows the PHP info for each server:



<?php
phpinfo();
?>

That will show you what the server is currently configured for as well as what the default value of every option is. Might want to do a side-by-side comparison between the PHP setup that works and the one adding the slashes to help narrow down the difference between the two.

- Shawn

mduke
Mar 5th 2004, 11:26 am
Well, shoot: sure enough, the Univ php.ini has all magic_quotes properties turned off, and OS X has the the magic_quotes_gpc and ..._runtime on. I will experiment with changing the settings. This will be interesting in that it may be why I had to do a workaround for a Dreamweaver MX site page referral wherein I had to use $_POST['fieldname'] in the query string instead of $fieldname (again, this was another "works on Unix but not on OS X" issue). It would be great if the magic-quotes settings were the root of all my evils because the minute I hand-code DW PHP extensions, it makes it difficult to do any further editing using the extension GUIs.

Well, this has been a most illuminating day. Good on ya, then!

killer2021
Nov 11th 2008, 5:00 pm
Well, shoot: sure enough, the Univ php.ini has all magic_quotes properties turned off, and OS X has the the magic_quotes_gpc and ..._runtime on. I will experiment with changing the settings. This will be interesting in that it may be why I had to do a workaround for a Dreamweaver MX site page referral wherein I had to use $_POST['fieldname'] in the query string instead of $fieldname (again, this was another "works on Unix but not on OS X" issue). It would be great if the magic-quotes settings were the root of all my evils because the minute I hand-code DW PHP extensions, it makes it difficult to do any further editing using the extension GUIs.

Well, this has been a most illuminating day. Good on ya, then!

Glad it could work out for you :)