Php:Adding an extension

Problem

You need PHP’s built-in ftp functions for the ultra-cool script you are writing, but your service
provider does not have PHP compiled with the –enable-ftp option.

Solution

If you have a shell account on a system with the same operating system as your web server, grab the
PHP source tarball and build using:

–with-apxs –enable-ftp=shared
You can check which flags your provider used by putting a phpinfo() call in a script on your server.

<?phpinfo()?>
Once compiled, you will find a “modules/ftp.so” file which you can copy to your web server and
enable either by putting:

extension=ftp.so
in your php.ini file or by adding this to the top of your script:

<?php dl(”ftp.so”) ?>

Tags: , , , , , , , , , , , , , ,

Leave a Reply