linux server installs PHP extension zip zlib method

  • 2020-10-07 18:58:05
  • OfStack

First, the Linux server has PHP installed

PHP each version download address: http: / / php net/releases /

In the case of 5.4.45, which I used, I put the downloaded zip pack in the /root/Downloads/ directory

Decompression compression package: ES16en-ES17en ES18en-5.4.45. tar. gz

Install PHP(Ignore)

Now take installing the zip extension as an example

> > cd /root/Downloads/php-5.4.45/ext/zip

> > find / -name phpize

> > / usr/local/php bin/phpize # 1 generated some version of the configuration file

> > ./configure --with-php-config=/usr/local/php/bin/php-config

> > make & & make install

After the last step is installed successfully, it will tell you the compiled address:


Build complete. 
Don't forget to run 'make test'. 
 
Installing shared extensions:  /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/ 

Modify php ini

> > find / -name php.ini# view the configuration file location

> > vi php. ini # modified php. ini increase extension = / usr/local/php/lib/php/extensions/no - debug - non - zts - 20100525 / zip so

> > :wq # save exit

Restart the server

> > service nginx restart

> > service php-fpm restart

Check out phpinfo()


Related articles: