Find which users are using php4?

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
I have a server that is about 3 years old now that was setup with php4 and php5 being options to users. I am planning on moving these accounts to a newer server running cloudlinux, but I dont want to setup php4 unless some users are still using it. Any ideas for finding out if any sites are using php4 still?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Hello :)

When PHP 5 is set as the default handler for PHP, PHP 4 is enabled through the .htaccess file of the account. You could write up a bash command to search the .htaccess files on the system to see which ones are using PHP 4. An example of such a command would be:

Code:
# find /home*/*/ -mindepth 1 -iname "\.htaccess" -type f -exec grep -Hi "x-httpd-php4" '{}' \;
Thank you.