php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11520 Same eregi() script, different OS's, different results
Submitted: 2001-06-17 11:30 UTC Modified: 2004-06-15 20:13 UTC
From: child_god at yahoo dot com Assigned:
Status: Closed Package: *Regular Expressions
PHP Version: 4.0.4pl1 OS: Win NT 4.0sp6a/Win2k Server/RedH
Private report: No CVE-ID: None
 [2001-06-17 11:30 UTC] child_god at yahoo dot com
This script from www.4cm.com works on Win NT 4.0sp6a and Win 2k Server without any problem, but fails on two different Red Hat Linux 7.1 machines.  One 7.1 machine is a Dell 166mhz with a 48mb of ram, the other is a Dell P3 600mhz with 384mb of ram. All machines are using php 4.0.4pl1. The red hat machines installed php at install time, server class installation, no mod_php installed (at least that's what rpm -qi mod_php said). Apache is compiled with mod_so.c

<?php
###############################################################
# Script Title: 4CM_Grabber
#         File: 4CM_Grabber.php
#  Description: This script will Grab information from a given web site
#       Author: John B. Abela
#        Email: support@4cm.com
#          Web: http://www.4cm.com/
#      Version: 2.0.5
#
#  Copyright ? 1996-2000 www.4cm.com.  All Rights Reserved.
#
#
#  www.4cm.com (4CM) offers no warranties on this script.
#  The downloader of the script is solely responsible for any
#  problems caused by the installation of the script or use
#  of the script, including possible legal action for the grabbing
#  of the data, as a result of this script!
#
#  ALL COPYRIGHT NOTICES REGARDING: www.4cm.com
#  MUST REMAIN INTACT IN THE SCRIPT AND IN THE HTML OF THE SCRIPT!  
#
#  For more info on this script, see:
#  http://www.4cm.com/
#
#  (Please be kind and sign our guestbook at:
#     http://www.4cm.com/guestbook/  and say your using
#       this script!!)
###############################################################

########################
## Mandatory Setting  ##
########################

$GrabURL = "http://www.theregister.co.uk";  //-  Complete URL Of The Page Your Grabbing From!
$GrabStart = "<!-- </td></Tr> -->";  //- HTML Code To Start Grab. Must Be A Unique Bit Of Code!
$GrabEnd = "<IMG SRC=\'/Themes/Normal/Sections.gif\' ALT=\'Sections\' BORDER=\'0\' WIDTH=\'150\' HEIGHT=\'15\'>";  //- HTML Code To End Grab. Must Be A Unique Bit Of Code!

#############################
## Do Not Edit Below Here  ##
## Do Not Edit Below Here  ##
#############################
$OpenFile = fopen("$GrabURL", "r"); //- DO NOT CHANGE
$RetrieveFile = fread($OpenFile, 200000);  //- Reduce This To Save Memory
$GrabData = eregi("$GrabStart(.*)$GrabEnd", $RetrieveFile, $DataPrint);
// $DataPrint[1] = str_replace("", "", $DataPrint[1]);   //- Un-Comment This Line for "Replace" purposes!
// $DataPrint[1] = str_replace("", "", $DataPrint[1]);   //- Un-Comment This Line for "Replace" purposes!
fclose($OpenFile); //- DO NOT CHANGE
echo $DataPrint[1]; //- DO NOT CHANGE
####################
## End of Script  ##
####################
?>

If i change the $GrabData = eregi(... line to
$GrabData = eregi("$GrabStart(.*)", ... basically taking out the $GrabEnd, the script works.  If i replace $GrabStart with $GrabEnd, the script works.

BUT, it will not work if I have both in the expression (on the Red Hat Linux 7.1 machines).

Why?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-17 14:24 UTC] sniper@php.net
What does it say in all of those systems in the phpinfo()
output for "Regex Library"?? Safest would be to use
the bundled one in all of them. 

You should also update to PHP 4.0.5 as it has some fixes
regarding regexps.


 [2001-06-18 19:44 UTC] sniper@php.net
Without seeing your configure line, remove
the --with-system-regex and reconfigure/compile (delete config.cache before configure) 

--Jani

 [2004-06-08 20:46 UTC] ozdu0001 at att dot net
Is this part solved?
I have same problem?
The script never finishes the job. At the end half page only... Kind of get interuppted by somehting...

Thanks,
 [2004-06-15 20:13 UTC] child_god at yahoo dot com
This bug was not really a bug.  The php binaries I used on the Windows and the Linux were compiled to use different regular expressions, one used the php bundled and the other used the system's.

My recommendation to you is to 1) post the code you are having problems with, and 2) compile php to use the bundled regular expressions so you have consistency across platforms and computers.
 [2004-06-30 07:30 UTC] doug at drdinc dot net
Has anyone come up with a solution to fix this problem. WE have done what is stated here but still no results.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 05:03:37 2021 UTC