grep -R "WHAT IVE TO FIND" /home/USER/domains/DOMAIN/public_html/*
the command for find a word or a sentence in all file is
Code:grep -R "WHAT IVE TO FIND" /home/USER/domains/DOMAIN/public_html/*
This will tell you the file and cat the line with the exact sentence (or word).
I suppose that USER should be also used with * but not sure.
Regards
You'll have to use an instance of sed like:
sed -i 's/\$HTTP_SERVER_VARS/\$_SERVER/g'
i.e.
find ./ -name "*.php" -exec sed -i 's/\$HTTP_POST_VARS/\$_POST/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_GET_VARS/\$_GET/g' {} \;
...
for each of the deprecated variables you might have in your files.
It also occurred to me a simple php conversion script would also work:
$search=array(
"/HTTP_SERVER_VARS/",
"/HTTP_POST_VARS/",
"/HTTP_ENV_VARS/",
"/HTTP_GET_VARS/",
"/HTTP_COOKIE_VARS/",
"/HTTP_SESSION_VARS/",
"/HTTP_POST_FILES/");
$replace=array(
"_SERVER",
"_POST",
"_ENV",
"_GET",
"_COOKIES",
"_SESSION","_FILES");
$content=file_get_contents("somefile.php");
$content=preg_replace($search,$replace,$content);
file_put_contents("somefile.php",$content);
add directory recursion functions, ect.
find ./ -name "*.php" -exec sed -i 's/\$HTTP_POST_VARS/\$_POST/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_GET_VARS/\$_GET/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_SESSION_VARS/\$_SESSION/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_COOKIE_VARS/\$_COOKIE/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_ENV_VARS/\$_ENV/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_SERVER_VARS/\$_SERVER/g' {} \;
find ./ -name "*.php" -exec sed -i 's/\$HTTP_POST_FILES/\$_FILES/g' {} \;
Function ereg() is deprecated in /home/username/domains/domain.com/public_html/includes/file.php on line 895
What error was showing the deprecated errors?
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
YepI guess something like....
no sense using php 5.2 anymore
PHP 5.2.17 (Old stable)
This version is no longer supported by PHP.net
being exploited...priceless
And there are no "replacement" for those functions?
Should those cause problem to websites?
Thanks for explanations
Regards
The following is a list of deprecated INI directives. Use of any of these INI directives will cause an E_DEPRECATED error to be thrown at startup.
define_syslog_variables
register_globals
register_long_arrays
safe_mode
magic_quotes_gpc
magic_quotes_runtime
magic_quotes_sybase
Comments starting with '#' are now deprecated in .INI files.
Deprecated functions:
call_user_method() (use call_user_func() instead)
call_user_method_array() (use call_user_func_array() instead)
define_syslog_variables()
dl()
ereg() (use preg_match() instead)
ereg_replace() (use preg_replace() instead)
eregi() (use preg_match() with the 'i' modifier instead)
eregi_replace() (use preg_replace() with the 'i' modifier instead)
set_magic_quotes_runtime() and its alias, magic_quotes_runtime()
session_register() (use the $_SESSION superglobal instead)
session_unregister() (use the $_SESSION superglobal instead)
session_is_registered() (use the $_SESSION superglobal instead)
set_socket_blocking() (use stream_set_blocking() instead)
split() (use preg_split() instead)
spliti() (use preg_split() with the 'i' modifier instead)
sql_regcase()
mysql_db_query() (use mysql_select_db() and mysql_query() instead)
mysql_escape_string() (use mysql_real_escape_string() instead)
Passing locale category names as strings is now deprecated. Use the LC_* family of constants instead.
The is_dst parameter to mktime(). Use the new timezone handling functions instead.
Deprecated features:
Assigning the return value of new by reference is now deprecated.
Call-time pass-by-reference is now deprecated.