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
/usr/local/php/bin/phpize

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 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 reads the module
vi /usr/local/php/etc/php.ini


extension_dir="/usr/local/php/etc/ext"
#Load The module 
extension=ftp.so

# save exit

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


Related articles: