Home  >  Article  >  Backend Development  >  An error occurs when compiling PHP during Linux installation

An error occurs when compiling PHP during Linux installation

小云云
小云云Original
2018-03-01 14:45:271492browse

Today when building LNMP to compile PHP, an error was reported: configure: error: jpeglib.h not found. This article will share with you how to solve such problems.

[root@cac3 php-5.6.22]# ./configure \
> --prefix=/usr/local/php5/ \
> - -enable-fpm \
> --enable-mbstring \
> --enable-bcmath \
> --enable-sockets \
> --with-config-file -path=/usr/local/php5/etc \
> --with-mysql=/usr/local/mysql/ \
> --with-mysqli=/usr/local/mysql/bin /mysql_con
mysql_config mysql_convert_table_format
mysql_config_editor mysql_convert_table_format
mysql_config -with-gettext \
> --with-jpeg-dir


After executing the above command, the following error message appears:

configure: error: jpeglib.h not found.


The solution is as follows:

[root@cac3 php-5.6 .22]# rpm -qa | grep libjpeg

libjpeg-turbo-1.2.90-5.el7.x86_64[root@cac3 php-5.6.22]# yum -y install libjpeg-devel
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving dependencies
--> Checking transaction
---> Package libjpeg-turbo-devel.x86_64.0.1.2.90-5.el7 will be installed


--> Dependency resolution completed

......

[root@cac3 php-5.6.22]# yum list installed | grep libjpeg

libjpeg-turbo.x86_64 1.2.90-5.el7 1.2.90- 5.el7 @yaya


[root@cac3 php-5.6.22]# rpm -ql libjpeg-turbo

/usr/lib64/libjpeg.so.62

/usr/lib64/libjpeg.so.62.1.0

/usr/share/doc/libjpeg-turbo-1.2.90/usr/share/doc/libjpeg-turbo-1.2.90/ChangeLog. txt
/usr/share/doc/libjpeg-turbo-1.2.90/README
/usr/share/doc/libjpeg-turbo-1.2.90/README-turbo.txt
/usr/share /doc/libjpeg-turbo-1.2.90/change.log
/usr/lib/libjpeg.so.62
/usr/lib/libjpeg.so.62.1.0
/usr/share/ doc/libjpeg-turbo-1.2.90
/usr/share/doc/libjpeg-turbo-1.2.90/ChangeLog.txt
/usr/share/doc/libjpeg-turbo-1.2.90/README
/usr/share/doc/libjpeg-turbo-1.2.90/README-turbo.txt



##/usr/share/doc/libjpeg-turbo-1.2. 90/change.log

#Compile again and it will be successful.

Related recommendations:

How to add openssl module to php without recompiling PHP

Compiling PHP Notes

After compiling php7, how to make apache support php7

The above is the detailed content of An error occurs when compiling PHP during Linux installation. For more information, please follow other related articles on the PHP Chinese website!

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