No need to recompile php to add the ftp extension to the solution

  • 2020-05-30 19:41:25
  • OfStack

First, go to the source directory
cd php-5.2.13/ext/ftp

# run phpize to generate configure

To compile, specify php-config, note php-config, not php.ini
./configure --with-php-config=/usr/local/php/bin/php-config
You can add -- enable-ftp, or you don't have to

# compile and install
make;make install

Generate 1 directory to hold the extended modules
mkdir /usr/local/php/etc/php/ext

Copy to the module directory
cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ /usr/local/php/etc/ext/

Edit the php.ini file to specify the directory to which PHP reads the module
vi /usr/local/php/etc/php.ini

#Load The module

# save exit

At this point, the ftp extension has been loaded successfully.

Related articles: