Results 1 to 14 of 14
  1. #1

    * help to solve it

    that message are appear at my web site i am not now how to

    fix it so please help me

    Deprecated: Function eregi() is deprecated in /home/xxx/public_html/xxx/xxx/functions.php on line 469

    Deprecated: Function eregi() is deprecated in /home/xxx/public_html/xxx/xxx/functions.php on line 469


    and the line 469 are that

    if (!(eregi('^[1-9]{1}[0-9]{0,2}$',$num)) && (!(eregi('^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$',$num)))) {

  2. #2
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    10,629
    What script are you using, Wordpress?
    l Dedigeeks Shared Wordpress Dedicated Established 2006
    l Leading AUSTRALIAN Hosting Provider Sydney & Melbourne Datacentres
    l cPanel/WHM R1Soft Backups 24/7/365 Support SMS Hosting Alerts*
    l www.dedigeeks.com Managing Director Service Superstars

  3. #3
    Join Date
    Mar 2004
    Posts
    551
    If you google for "eregi php" you'll come up with helpful links like this which answer your question:

    http://devthought.com/2009/06/09/fix...ors-in-php-53/

  4. #4
    You can use a host using php 5.2.17 (latest stable version of 5.2). Lots of scripts do not work with 5.3.xx.
    HostXNow - Shared Web Hosting | Semi Dedicated Hosting | Enterprise Reseller Hosting | VPS Hosting

  5. #5
    Join Date
    Apr 2011
    Location
    Philippines
    Posts
    301
    As what I learned your host has upgraded it's php version or has very sensitive error reporting. Those messages are NOT errors, just notices and one thing you have to know is that everything still works as it should. Just Google the exact message appears and you'll immediately see a solution for it.

  6. #6
    Join Date
    Jun 2003
    Location
    California
    Posts
    2,786
    Quote Originally Posted by azhar014 View Post
    that message are appear at my web site i am not now how to

    fix it so please help me

    Deprecated: Function eregi() is deprecated in /home/xxx/public_html/xxx/xxx/functions.php on line 469

    Deprecated: Function eregi() is deprecated in /home/xxx/public_html/xxx/xxx/functions.php on line 469


    and the line 469 are that

    if (!(eregi('^[1-9]{1}[0-9]{0,2}$',$num)) && (!(eregi('^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$',$num)))) {
    If you can, contact the script author to get the newest version, or advise him that he needs to update his deprecated functions. For this one, there is no exact replacement for eregi using preg_match, but there are workarounds (see this page for more info).

    PHP recommends not having these messages write to the screen in a production server, but shared hosts often leave them so the customers know when a script needs updating. Your host may be able to suppress the warnings for you, either by complying with the PHP recommendation or installing a local php.ini file for you.

    If you are on a limited disk space plan, look for an "error_log" file in the directory where the errors are happening. It is easy for these log files to grow quickly to hundreds of megabytes. Logging can be turned off in php.ini also.

  7. #7
    Join Date
    Jul 2003
    Location
    US
    Posts
    61
    you can also place display_errors=Off into your php.ini file and those warning will not be displayed.
    Rotmax - Advanced Hosting Solutions
    | Providing premium hosting since 2001.
    | http://www.rotmax.com
    | Follow us on Facebook: Rotmax-Facebook

  8. #8
    Quote Originally Posted by ivounnerry View Post
    As what I learned your host has upgraded it's php version or has very sensitive error reporting. Those messages are NOT errors, just notices and one thing you have to know is that everything still works as it should. Just Google the exact message appears and you'll immediately see a solution for it.
    Wrong, deprecated means deprecated the script(s) will need some work or ask to be moved to a server with the same PHP version it used to have.
    StableHost.com - Home to over 23,000 websites.
    Contact us: 866.945.6952
    Offering: 24/7/365 Support, Web Builder and Softaculous.
    Read over 100+ reviews about us at RateLobby!

  9. #9
    Join Date
    Jun 2003
    Location
    California
    Posts
    2,786
    Quote Originally Posted by MrNerd View Post
    Wrong, deprecated means deprecated the script(s) will need some work or ask to be moved to a server with the same PHP version it used to have.
    The functions deprecated with the latest version still work ... for now. They will stop working (i.e., be removed) as of PHP 6. On a production server, you aren't even supposed to have them print to the screen (here's a quote from PHP.INI):

    ; Print out errors (as a part of the output). For production web sites,
    ; you're strongly encouraged to turn this feature off, and use error logging
    ; instead (see below). Keeping display_errors enabled on a production web site
    ; may reveal security information to end users, such as file paths on your Web
    ; server, your database schema or other information.
    display_errors = Off
    Most hosts keep "display_errors = On" because otherwise the customers won't know there's a problem.

    There is nothing wrong with using "display_errors = Off", as PHP.net recommends, while you work on fixing the errors. You don't have to panic; PHP 6 is quite a ways off still.

  10. #10
    display_errors = Off should be used on a productions server. The only time it should be turned on is in a development server.

    However, there is not any reason to switch to a host that uses an older version of php just so you can run your script. PHP 5.3 is actually faster if the script is upgraded. If you like your host, then keep them. The errors will show up even if you turn off display_errors and it will fill your error log. You just won't be able to see them on the screen.

    To fix your issue this would be the most likely fix. However, depending on the script you may actually be able to use strstr instead of preg_match. Because they are regular expressions you might need to simply try both and make sure they work. strstr is faster than preg_match in some cases while it is the reverse in others.

    if (!(eregi('^[1-9]{1}[0-9]{0,2}$',$num)) && (!(eregi('^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$',$num)))) {

    Change to:

    if (!(preg_match('/^[1-9]{1}[0-9]{0,2}$/i',$num)) && (!(preg_match(/'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$/i',$num)))) {

    I personally like this better.

    if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match(#'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {

    I haven't seen the rest of the script so it maybe need a little tweaking. But the error is just a depreciated error and shouldn't cause any errors with the way the script runs. These errors only show up because the function is no longer supported in php 5.3+. The function will be removed from php 6.

    Note: The fixes above are examples that should work but i only posted them so you can see what your script should look like with the changes. Because I don't know what the script is I can't exactly tell you the correct fix for it. On the plus side, it will tell you if it is wrong. If you do try it, just make a backup first.

  11. #11

    Thumbs up

    Quote Originally Posted by killigan View Post
    display_errors = Off should be used on a productions server. The only time it should be turned on is in a development server.

    However, there is not any reason to switch to a host that uses an older version of php just so you can run your script. PHP 5.3 is actually faster if the script is upgraded. If you like your host, then keep them. The errors will show up even if you turn off display_errors and it will fill your error log. You just won't be able to see them on the screen.

    To fix your issue this would be the most likely fix. However, depending on the script you may actually be able to use strstr instead of preg_match. Because they are regular expressions you might need to simply try both and make sure they work. strstr is faster than preg_match in some cases while it is the reverse in others.

    if (!(eregi('^[1-9]{1}[0-9]{0,2}$',$num)) && (!(eregi('^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$',$num)))) {

    Change to:

    if (!(preg_match('/^[1-9]{1}[0-9]{0,2}$/i',$num)) && (!(preg_match(/'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$/i',$num)))) {

    I personally like this better.

    if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match(#'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {

    I haven't seen the rest of the script so it maybe need a little tweaking. But the error is just a depreciated error and shouldn't cause any errors with the way the script runs. These errors only show up because the function is no longer supported in php 5.3+. The function will be removed from php 6.

    Note: The fixes above are examples that should work but i only posted them so you can see what your script should look like with the changes. Because I don't know what the script is I can't exactly tell you the correct fix for it. On the plus side, it will tell you if it is wrong. If you do try it, just make a backup first.
    Thanks to all of you and specially killigan for helping me
    to fix that problem now it is solved that one works

    if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match(#'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {

    only one error in the red Single Quote are before the hash.
    again thanks to all of you for helping me.

  12. #12
    That was a typo. Sorry about that. This is the correct edit.

    if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match('#^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {

  13. #13
    Quote Originally Posted by killigan View Post
    That was a typo. Sorry about that. This is the correct edit.

    if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match('#^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {
    No matter sooooooo many thanks for that.

  14. #14
    Anytime. Glad I could help.

Similar Threads

  1. Can you solve this?
    By incubus898 in forum Web Design and Content
    Replies: 7
    Last Post: 03-31-2011, 11:56 PM
  2. solve this
    By Soskel34 in forum Web Hosting Lounge
    Replies: 7
    Last Post: 04-27-2008, 12:47 AM
  3. how i can solve this ???
    By soonhelp in forum Dedicated Server
    Replies: 2
    Last Post: 08-31-2004, 04:45 PM
  4. How Do I Solve This?
    By [inx]Olly in forum Hosting Security and Technology
    Replies: 0
    Last Post: 10-08-2003, 04:35 AM
  5. can you solve this one
    By Arabiahosts in forum Programming Discussion
    Replies: 3
    Last Post: 01-05-2003, 03:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •