WireNine

Well-Known Member
Aug 14, 2006
207
4
168
cPanel Access Level
Root Administrator
Deselecting PHP 4 when recompiling Apache does not remove PHP 4 from the server.

How can we completely remove all traces of php 4 from the server and disable it using EasyApache?
 

WebScHoLaR

Well-Known Member
Dec 14, 2005
508
3
168
Planet Earth
How can we completely remove all traces of php 4 from the server and disable it using EasyApache?
A manual way is to run a find command on php4, verify the files that it finds and then remove them. It will be something like:

find /usr -name php4* (To get the list of files)

find /usr -name php4* | xargs rm -rvf (To delete the php4 files/folders)

As far as disabling it in EasyApache, I don't think its possible unless cPanel stops supporting PHP4.
 

WireNine

Well-Known Member
Aug 14, 2006
207
4
168
cPanel Access Level
Root Administrator
Isn't it possible for EasyApache to remove all the files from the server since it's not selected any longer? I don't mean remove support for it, but remove php4 files from the server.
 

mm1250

Well-Known Member
Nov 10, 2006
108
0
166
I remember I had this happen to me where PHP4 was installed and when attempting to fully uninstall it it was literally a mission. I think a ticket to cPanel and they will go in and remove it all for you.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
If you run EasyApache compile for PHP5 only (without PHP4), you shouldn't have PHP4 installed on your server.

However, as far as removing an existing PHP4 installation, you will need to remove those files manually.

First thing you need to do is go ahead and make sure that your system has PHP5 up and running correctly and then log into your SSH shell and delete
the binaries for PHP4 from your server.

Here is a simple script to help you with that:
Code:
#!/bin/bash
IFS="$"

PDSO="/usr/local/apache/modules/libphp4.so"
CGIA="/usr/local/php4"
CGIB="/usr/php4"

for PHP in ${PDSO} ${CGIA} ${CGIB}; do 
  if [ -f ${PHP} ]; then
    echo "Found ${PHP} :  Deleting binary file ..."
    rm -f ${PHP}
  fi
done

if [ -d /usr/local/php4 ]; then
   echo "Removing PHP4 folder in /usr/local/php4 ..."
   rm -Rf /usr/local/php4/*
   rmdir /usr/local/php4
fi

echo "You should review the following files and remove PHP4 references ..."

echo "/usr/local/apache/conf/httpd.conf"
echo "/usr/local/apache/conf/php.conf"

if [ -f /opt/suphp/etc/suphp.conf ]; then
   echo "/opt/suphp/etc/suphp.conf"
fi

# End of Script
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Correct, PHP 4 is not removed upon deselecting it from EasyApache. The same holds true for PostgreSQL, Tomcat and a slew of other components. If you select to have them not compile after initial installation, the components remain on the machine. This is likely due to the fact that you might later change your mind and want the contents as a backup.