This article introduces you to the method of adding ftp extension without recompiling php. if you need it, refer to the following. First, go to the source code directory.
Cd php-5.2.13/ext/ftp
# Run phpize to generate configure
/Usr/local/php/bin/phpize
# Compile and specify php-config. Note that the php-config here is not php. ini.
./Configure -- with-php-config =/usr/local/php/bin/php-config
# You can add -- enable-ftp or not.
# 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 to specify the directory to which PHP is read.
Vi/usr/local/php/etc/php. ini
The code is as follows:
Extension_dir = "/usr/local/php/etc/ext"
# Load module
Extension = ftp. so
# Save and exit
Now, the ftp extension is successfully loaded.