This question is asked to gain understanding and find the answer for 'clean-up' (aka organization). File this under Server Maintenance.
It seems sometimes that servers will become cluttered over time. Recently, I discovered that there are four versions of curl on the server. Thankfully, recent versions of curl and PHP are available (and actively updated) under EA-4.
Firstly, the server is running beautifully with EA-4. These recent versions are available via HTTP and cron - when cron is run with something like: /usr/local/bin/ea-php71.
When I recently checked whereis php and whereis curl, I saw this jumble ...
and when I followed some of these, the output was:
OK. PHP looks like it has been aliased to the updating EA4 version. That's good news.
But, when I checked on curl (which I use a lot), three older versions appeared.
When I checked /usr/bin, this was the (abbreviated) output
(... omitting the same from /usr/local/bin for brevity)
This tells me that PHP (and, I think the curl it contains) has been aliased to /opt/cpanel/ea-php71/root/usr/bin/php-cgi*. Great! This is the PHP I want HTTP and cron to have available.
Questions:
1. Does the server need, the unaliased php*, php5-cgi, php5-cli, php-config and curl* contained in /usr/bin?
2. If the answer to 1 is No, is there another way to remove these (especially curl) than just deleting them?
3. The 4th curl version reports 7.63.0. Where is this curl version, and is it possible to alias the other whereis curl locations to that folder?
I am asking this question, because I want a clear understanding of which curl is being used in different circumstances. At this moment, if the server is accessed via command line, an old version of curl is there - waiting to answer.
I did clean up some php5.5 and php5.6 directories after upgrading to EA3 and then EA4, but it seems that remnants of the original system will always hang around, unless a clean up is performed.
David
It seems sometimes that servers will become cluttered over time. Recently, I discovered that there are four versions of curl on the server. Thankfully, recent versions of curl and PHP are available (and actively updated) under EA-4.
Firstly, the server is running beautifully with EA-4. These recent versions are available via HTTP and cron - when cron is run with something like: /usr/local/bin/ea-php71.
When I recently checked whereis php and whereis curl, I saw this jumble ...
Code:
[email protected] [~]# whereis php
php: /usr/bin/php /etc/php.ini /usr/local/bin/php /usr/local/lib/php.ini,v /usr/local/lib/php.ini /usr/local/lib/php
[email protected] [~]# whereis curl
curl: /usr/bin/curl /usr/local/bin/curl /opt/curlssl/bin/curl /usr/share/man/man1/curl.1.gz
Code:
[email protected] [~]# /usr/bin/php -v
PHP 7.1.26 (cgi-fcgi) (built: Feb 5 2019 02:28:26)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
[email protected] [~]# /usr/local/bin/php -v
PHP 7.1.26 (cli) (built: Feb 5 2019 02:28:06) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
[email protected] [~]# /usr/local/lib/php -v
-bash: /usr/local/lib/php: is a directory
But, when I checked on curl (which I use a lot), three older versions appeared.
Code:
[email protected] [~]# /usr/bin/curl -V
curl 7.48.0 (x86_64-redhat-linux-gnu) libcurl/7.48.0 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.10.0 libidn/1.18 libssh2/1.4.2
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets Metalink
[email protected] [~]# /usr/local/bin/curl -V
curl 7.50.3 (x86_64-pc-linux-gnu) libcurl/7.50.3 OpenSSL/1.0.2j zlib/1.2.8 libidn/1.18 nghttp2/1.15.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets
[email protected] [~]# /opt/curlssl/bin/curl -V
curl 7.24.0 (x86_64-unknown-linux-gnu) libcurl/7.24.0 OpenSSL/1.0.0 zlib/1.2.3 libidn/1.18
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz
Code:
[email protected] [/usr/bin]# ls -l
...
-rwxr-xr-x 1 root root 171888 Mar 29 2016 curl*
...
lrwxrwxrwx 1 root root 41 Feb 7 04:12 ea-php70 -> /opt/cpanel/ea-php70/root/usr/bin/php-cgi*
lrwxrwxrwx 1 root root 38 Feb 7 04:12 ea-php70-pear -> /opt/cpanel/ea-php70/root/usr/bin/pear*
lrwxrwxrwx 1 root root 38 Feb 7 04:12 ea-php70-pecl -> /opt/cpanel/ea-php70/root/usr/bin/pecl*
lrwxrwxrwx 1 root root 41 Feb 7 04:12 ea-php71 -> /opt/cpanel/ea-php71/root/usr/bin/php-cgi*
lrwxrwxrwx 1 root root 38 Feb 7 04:12 ea-php71-pear -> /opt/cpanel/ea-php71/root/usr/bin/pear*
lrwxrwxrwx 1 root root 38 Feb 7 04:12 ea-php71-pecl -> /opt/cpanel/ea-php71/root/usr/bin/pecl*
lrwxrwxrwx 1 root root 41 Feb 7 04:12 ea-php72 -> /opt/cpanel/ea-php72/root/usr/bin/php-cgi*
lrwxrwxrwx 1 root root 38 Feb 7 04:12 ea-php72-pear -> /opt/cpanel/ea-php72/root/usr/bin/pear*
lrwxrwxrwx 1 root root 38 Feb 7 04:12 ea-php72-pecl -> /opt/cpanel/ea-php72/root/usr/bin/pecl*
...
-rwxr-xr-x 1 root root 937 Jan 29 21:06 php*
lrwxrwxrwx 1 root root 12 Apr 21 2016 php5-cgi -> /usr/bin/php*
lrwxrwxrwx 1 root root 18 Apr 21 2016 php5-cli -> /usr/local/bin/php*
lrwxrwxrwx 1 root root 18 Apr 21 2016 php-cli -> /usr/local/bin/php*
lrwxrwxrwx 1 root root 25 Apr 21 2016 php-config -> /usr/local/bin/php-config
This tells me that PHP (and, I think the curl it contains) has been aliased to /opt/cpanel/ea-php71/root/usr/bin/php-cgi*. Great! This is the PHP I want HTTP and cron to have available.
Questions:
1. Does the server need, the unaliased php*, php5-cgi, php5-cli, php-config and curl* contained in /usr/bin?
2. If the answer to 1 is No, is there another way to remove these (especially curl) than just deleting them?
3. The 4th curl version reports 7.63.0. Where is this curl version, and is it possible to alias the other whereis curl locations to that folder?
I am asking this question, because I want a clear understanding of which curl is being used in different circumstances. At this moment, if the server is accessed via command line, an old version of curl is there - waiting to answer.
I did clean up some php5.5 and php5.6 directories after upgrading to EA3 and then EA4, but it seems that remnants of the original system will always hang around, unless a clean up is performed.
David
Last edited: