Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 301 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to solve the use of deprecated function ereg() of PHP 5.3.0 in Drupal 6.13

#1
Anyone knows how to solve the error below?

> Deprecated: Function ereg() is deprecated in C:\wamp\www\includes\file.inc on line 895

It is happening after installing Drupal 6.13 on wamp server 2.0i with PHP 5.3.0
Reply

#2
Looks like the problem is with PHP 5.3.0. You could try downgrading to 5.2.9 as suggested by this drupal link: [

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#3
You can edit you common.inc file to quietly disregard the deprecated error flags. See my post:
<a href="http://funkinetics.org/klink/function-ereg-is-deprecated-error-in-drupal-6x-with-php-53/">http://funkinetics.org/klink/function-ereg-is-deprecated-error-in-drupal-6x-with-php-53/</a>
Reply

#4
One solution is to upgrade the offending sourcecode :-)
It's explained here:

[To see links please register here]

Reply

#5
Because I don't have time to update legacy code, I addeded following line to php code to suppress warnings.

error_reporting(E_ALL ^ E_DEPRECATED);


this line suppress only deprecated warnings. other errors are shown as usual.
Reply

#6
Just add **@** in front of the function. e.g.

@ereg()



more issue relating upgraded your web servers which running PHP 5.3.0, pls refer

[

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#7
This is not a Drupal issue.In the Drupal site it is noted that it does not yet support PHP 5.3 and there have been new error flags added to PHP.

Solution1 : You can degarde the PHP version.You can revert back to PHP 5.2.x. As I am unsure of other conflicts with Drupal and PHP 5.3.

Solution2 : However, if you prefer to keep PHP 5.3, you can always suppress the deprecated function errors. In Drupal’s includes/common.inc,
Find the line :

if ($errno & (E_ALL ^ E_NOTICE)) {
And replace it with:

if ($errno & (E_ALL & ~E_NOTICE & ~E_DEPRECATED)) {

This will now always suppress the Deprecated error messages.
Reply

#8
Drop your error reporting level <a href="http://www.php.net/manual/en/errorfunc.constants.php">below E_DEPRECATED</a>.

PHP 5.3 introduced two new error reporting levels, E_DEPRECATED and E_USER_DEPRECATED and - for the first time in PHP's history - they've started to walk away from older parts of their API. The ereg_* function will still work, but this warning is intended to let you know that "hey, these function will be going away soon, probably in the next major revision).
Reply

#9
Use

preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension);

Instead of

ereg('\.([^\.]*$)', $this->file_src_name, $extension);
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through