Home  >  Article  >  Backend Development  >  How to install gd library in php-cli environment?

How to install gd library in php-cli environment?

WBOY
WBOYOriginal
2016-12-01 00:25:191532browse

There are a lot of pictures to process now, but I found that when writing gd functions in cli mode, an error is reported, that is, the gd-related functions are all undefined.

How to install the gd library or modify the configuration in this case?

PS: The gd library can be used in cgi mode.

Reply content:

There are a lot of pictures to process now, but I found that when writing gd functions in cli mode, an error is reported, that is, the gd-related functions are all undefined.

How to install the gd library or modify the configuration in this case?

PS: The gd library can be used in cgi mode.

Executephp --iniSee if the configuration used by php-cli is the same as php-cgi. Using the same one should ensure that php-cli can also load the PECL module of php-cgi. Or find gd directly Module, load it explicitly in the configuration:
extension=php_gd.so

phpize

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn