First, enter the source code directory
cd php-5.2.13/ext/ftp
#Run phpize to generate configure
/usr/local/php/bin/phpize
#Compile, specify php-config, note that php-config here is not php.ini
./configure --with-php-config=/usr/local/php/bin/php-config
# You can add --enable-ftp above, or you don’t need to add it
#Compile and install
make;make install
#Generate a directory to store extended modules
mkdir /usr/local/php/etc/php/ext
#Copy ftp.so to the module directory
cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ftp.so /usr/local/php/etc/ ext/
#Edit the php.ini file and specify the directory to which PHP reads the module
vi /usr/local/php/etc/php.ini
#Save and exit
At this point, the loading of the ftp extension is successfully completed.