Method: 1. Execute the "cd php-5.2.13/ext/ftp" command to enter the source directory; 2. Run phpize to generate configure; 3. Compile and specify php-config; 4. Use the make command to compile and install ;5. Open the php.ini file, configure the module directory, save and exit.
The operating environment of this tutorial: CentOS 6 system, PHP version 7.1, Dell G3 computer.
How to install the php ftp module (php-FTP extension)
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 --enable-ftp #上面可以添加--enable-ftp,也可以不用添加
Compile and install
make && make install
Edit the php.ini file and specify the directory to which PHP reads the module
vi /usr/ local/php/etc/php.ini
#编辑扩展模块目录 extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" #Load模块 extension=ftp.so
Save and exit
At this point, the loading of the ftp extension is successfully completed.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install php ftp module. For more information, please follow other related articles on the PHP Chinese website!