why does easyapache build two different copies of PHP ?

aww

Well-Known Member
Feb 10, 2005
152
0
166
cPanel Access Level
Root Administrator
I noticed easyapache builds two different copies of PHP from the same source.

One for "apache and cli" and another "for system"

The first goes into /usr/local/bin/
and the other into /usr/bin/

What is the "system" copy used for?

Strangely the binaries are the same size, though the helper programs like phpize and php-config vary

Code:
ls /usr/local/bin/php* -latri               
1854523 -rwxr-xr-x 1 root root 21950274 Dec 25 05:14 /usr/local/bin/php
1854525 -rwxr-xr-x 1 root root     4502 Dec 25 05:15 /usr/local/bin/phpize
1854489 -rwxr-xr-x 1 root root     3332 Dec 25 05:15 /usr/local/bin/php-config

ls /usr/bin/php* -latri      
1820509 -rwxr-xr-x 1 root root 21950274 Dec 25 05:18 /usr/bin/php
5210474 -rwxr-xr-x 1 root root     4490 Dec 25 05:18 /usr/bin/phpize
1820669 -rwxr-xr-x 1 root root     3314 Dec 25 05:18 /usr/bin/php-config
1820697 lrwxrwxrwx 1 root root       18 Dec 25 05:19 /usr/bin/php5-cli -> /usr/local/bin/php
1820696 lrwxrwxrwx 1 root root       12 Dec 25 05:19 /usr/bin/php5-cgi -> /usr/bin/php
1820698 lrwxrwxrwx 1 root root       18 Dec 25 05:19 /usr/bin/php5 -> /usr/local/bin/php
1820700 lrwxrwxrwx 1 root root       18 Dec 25 05:19 /usr/bin/php-cli -> /usr/local/bin/php
1820699 lrwxrwxrwx 1 root root       12 Dec 25 05:19 /usr/bin/php-cgi -> /usr/bin/php
(they are obviously not soft or hardlinks based on the inodes being different)
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
cPanel Access Level
Root Administrator
That actually was an interesting writeup.

Maybe you can ask Kenneth to quickly comment on why easyapache compiles twice into /usr/local/bin/ and /usr/bin/ and not just a softlink

If I was to bet, I'd say it was for legacy reasons. But I cannot find anything purposely using the /usr/bin/ copy

It also doubles easyapache completion time (for php) so maybe that's a performance improvement cpanel should look at, turning the remaining php references in /usr/bin into softlinks to /usr/local

When I turn on php-fpm, it also builds into /usr/sbin and and /usr/local/sbin - crazy duplication.