In the LINUX+NGINX+PHP+MYSQL environment, no PHP FTP extension was added to the deployment.
1, find the installed PHP source Package extracted folder
Go to the extension directory to FTP #/ROOT/PHP-5.3.6/EXT/FTP (Press your own software path)
2. Call the Phpize program to generate the compilation configuration file
[Email protected] ftp]#/usr/local/php/bin/phpize
Note: Cannot find CONFIG.M4.
Make sure this you run '/home/admin/php/bin/phpize ' in the top level source directory of the module
If the above error occurs, check whether to enter the FTP extension directory
3. Compile the extension library and perform the following configure and make commands, respectively.
#./configure--with-php-config=/usr/local/php/bin/php-config
#configure这一步执行通过后, and then execute the make command
#make
When make is executed successfully, the resulting extension library file is in the modules subdirectory of the current directory,
[Email protected] ftp]# CD modules/
[[email protected] modules]# ls
Ftp.la ftp.so
4. Edit the php.ini document, locate the Extension_dir directory, and copy the compiled extension file to extension
Find line No. 491 See extension_dir = "//usr/local/php/lib/php/extensions/"
[[email protected] modules] #cp ftp.so/usr/local/php/lib/php/extension
5. In php.ini Add extension library location, set the extension library to be added.
Add extension = "ftp.so" at 612
6. Restart PHP-FPM Service
If you do not restart the FPM service properly, you can directly
#killall PHP-FPM
And then execute
#/usr/local/php/sbin/php-fpm
Linux PHP configuration FTP extension