Centos configure error no acceptable c compiler found in path

I am facing the following error, while installing the C compiler itself (gcc gnu). configure: error: in `/home/gcc-5.3.0': configure: error: no acceptable C compiler found in $PATH Noting that I...

I am facing the following error, while installing the C compiler itself (gcc gnu).

configure: error: in `/home/gcc-5.3.0':
configure: error: no acceptable C compiler found in $PATH

Noting that I have tried the solutions listed in this question with no success.

OS: RHEL6 and CentOS

Community's user avatar

asked Feb 25, 2016 at 17:58

Eng7's user avatar

You need to install a compiler to compile. The solutions in the mentioned question should work:

yum install gcc

or

yum groupinstall "Development tools"

After that, try to run your compiler to make sure everything is aligned:

gcc

answered Feb 26, 2016 at 12:44

xian's user avatar

xianxian

7016 silver badges6 bronze badges

Содержание

  1. How to Solve Source Compile Error configure: error: no acceptable C compiler found in $PATH in Linux CentOS
  2. Description on The Error Triggered upon Compilation Process
  3. Steps taken to Solve Error Compilation Problem in CentOS 7
  4. Solve Configure: Error: No Acceptable C Compiler Found in $PATH
  5. Install gcc to Solve configure: error: no acceptable C compiler found in $PATH
  6. Проблемы при установке Asterisk
  7. Ошибки компиляции asterisk
  8. no acceptable C compiler
  9. error: C++ preprocessor «/lib/cpp» fails sanity check
  10. configure: error: *** termcap support not found
  11. configure: *** XML documentation will not be available because the ‘libxml2’ development package is missing
  12. configure: WARNING: *** Asterisk now uses SQLite3 for the internal Asterisk database.
  13. Doxygen is not installed
  14. Ошибки при компиляции asterisk 12 / asterisk 13
  15. configure: error: *** uuid support not found
  16. configure: error: *** JSON support not found
  17. Ошибки при запуске asterisk
  18. Permission denied
  19. ILLEGAL INSTRUCTION
  20. How to Resolve Configure: Error: no acceptable C compiler found in $PATH
  21. Python Installation
  22. no acceptable C compiler found in $PATH
  23. libffi-devel is Required
  24. GeoIP Installation via PECL
  25. no acceptable C compiler found in $PATH
  26. geoip-1.1.1 is Required

How to Solve Source Compile Error configure: error: no acceptable C compiler found in $PATH in Linux CentOS

Description on The Error Triggered upon Compilation Process

Sometimes, in the process of compiling source, there will be a specific error similar with the error as specifies in the title of the article. This error is an error for an example, it is generated in the process of compiling a PostgreSQL Database Server’s source. Below is the display of the error messages as the output of PostgreSQL Database Server’s source compilation process :

The above output displays an error message pointing out that there is no acceptable C compiler found in $PATH. In this context, the compilation process of PostgreSQL Database Server cannot go further. Even though the above compilation process is using a root account. It is because there is no C compiler available that is working in the root environment shell. In order to solve this problem, just install the packages or tool for the compile process requirement. There will be a case or example for installing the package or tool in Linux CentOS operating system distribution.

Steps taken to Solve Error Compilation Problem in CentOS 7

In the case of CentOS 7 Linux operating system distribution, below is the steps for installing the requirement package or tools for compiling source files :

1. First of all, search the available packages using the default tool for managing software, packages or tools in Linux CentOS operating system distribution. It is the ‘yum’ package tool. Type the following command to search the compiler package or tool :

The following is the output of the above command execution :

As shown in the above output, there is a package or a tool named ‘gcc’. This tool has an short information based on the above output. It is a Various compilers (C, C++, Objective-C, Java, …). Actually, this is the package or the tool suitable for compiling file sources.

2. After that, try to search the complete info about the package or tool named ‘gcc’. To be able to retrieve the information, type the following command in the command line :

The following is the output of the above command execution :

3. Fortunately, there is another alternative for installing the package or tool. It is by installing a group of package. Basically, ‘gcc’ package is available in that group package. To be able to enlist all of the group package available, just type the following command :

After typing the above command in a command line interface, the following is the output of that command execution :

3. Furthermore, using the output of the above command execution as a reference, there is one group package suitable for the source files compilation task. That group package is the ‘Development Tools’. Just type the following command to retrieve more information about that group package :

The following is the output of the above command execution :

Hence, using the information in the above output, it is already make sense for installing the group package Development Tools. On the output command execution above, there are detail information given about all the package or tools available in the group package Development Tools. If the group package is installed, every packages or tools located inside of the group package will automatically be installed.

4. Start installing the group package Development Tools. Type the following command to start installing the group package :

The following is the output of the above command execution :

5. Finally, after the above installation process is finished, try to execute the command ‘gcc’ which is referring to the tool of ‘gcc’ as follows :

That means, the ‘gcc’ tool is available. It exists to perform the compilation process. Try to execute the compile command again.

Источник

Solve Configure: Error: No Acceptable C Compiler Found in $PATH

When you install a package or application, there are several dependencies that such a package runs on. These dependencies power some (or all) parts of the package.

Often, some of these dependencies are bundled together or downloaded during installation. Other times, it is expected to be present within your system.

For Linux, a big example is when installing Python. The C compiler is an important dependency that it needs.

Well, that’s because Python is written in C. However, we might not have the C compiler present, and it is expected by the Python developers to be present on your Linux PC.

This article will show you how to solve the error message configure: error: no acceptable C compiler found in $PATH when installing Python or any package that needs the C compiler.

Install gcc to Solve configure: error: no acceptable C compiler found in $PATH

The GNU Compiler Collection (GCC) is a compiler that holds compilers for different programming languages from C and C++ to Go. In addition to these compilers, it holds important libraries run on the programming languages it supports.

From the description, we know it holds the C compiler that is not found in our $PATH . Therefore, if you see this error message configure: error: no acceptable C compiler found in $PATH , the gcc compiler can help you solve it.

Let’s create the same error message scenario by installing Python on our Ubuntu PC. To install Python, we need to download the tgz file, a compressed archive file using the GNU zip ( gzip ) software holding the Python package.

To download the Python tgz file, we can use the wget command.

The output of the command above is the below, and the Python-3.10.6.tgz file is present within the working directory we executed in the above command.

You can use the ls command to check for the file we downloaded. Afterward, we can extract the Python-3.10.6.tgz file using the below command.

The code output is below and an extracted directory, Python-3.10.6 .

Now, let’s cd into the directory.

Then, make a hidden directory using the command below.

Now, let’s configure the Python $PATH to allow us to access Python anywhere.

Here is where the error message pops up.

You can see the second to the last line with the error message, configure: error: no acceptable C compiler found in $PATH .

As we said earlier, the gcc compiler holds the C compiler we need to allow us to install Python successfully. So, let’s install the gcc compiler using the command below.

The above command installs a meta-package that doesn’t install anything but provides a link to several other packages installed as dependencies. For build-essential , it installs everything required for compiling basic software written in C and C++.

These include the compiler we need, gcc , g++ , libc6-dev , make , and dpkg-dev . We can write and run C and C++ software on Ubuntu with all these packages.

For other distributions or bases, the command will be different.

We can repeat our configure command with the complete command execution.

Now, it is successful. Afterward, we execute the command below, which builds the Python program and files from the source code extracted into the current working directory.

Finally, we execute this command to install the Python program.

Therefore, to solve the configure: error: no acceptable C compiler found in $PATH error message, all you need to do is install gcc , which comes with the meta-package, build-essentials on Ubuntu or similar distros.

Olorunfemi is a lover of technology and computers. In addition, I write technology and coding content for developers and hobbyists. When not working, I learn to design, among other things.

Источник

Проблемы при установке Asterisk

Ошибки компиляции asterisk

no acceptable C compiler

Текст ошибки:
configure: error: in `/usr/src/asterisk-11.14.0′:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details

Описание ошибки:
Отсутствует компилятор gcc

Решение:
Необходимо установить пакет GCC. Для этого в CentOS выполните команду:
yum -y install gcc

error: C++ preprocessor «/lib/cpp» fails sanity check

Текст ошибки:
configure: error: in `/usr/src/asterisk-11.14.0′:
configure: error: C++ preprocessor «/lib/cpp» fails sanity check

Описание ошибки:
Отсутствует компилятор gcc-c++

Решение:
Необходимо установить пакет GCC-C++. Для этого в CentOS выполните команду:
yum -y install gcc-c++

configure: error: *** termcap support not found

Текст ошибки:
configure: error: *** termcap support not found (on modern systems, this typically means the ncurses development package is missing)

Описание ошибки:
Отсутствует библиотека ncurses, точнее не сама библиотека (она может быть), а ее компоненты для разработчиков (development), для сборки программ.

Решение:
В случае CentOS нужен пакет ncurses-devel:
yum -y install ncurses-devel

configure: *** XML documentation will not be available because the ‘libxml2’ development package is missing

Текст ошибки:
configure: *** XML documentation will not be available because the ‘libxml2’ development package is missing.
configure: *** Please run the ‘configure’ script with the ‘—disable-xmldoc’ parameter option
configure: *** or install the ‘libxml2’ development package.

Описание ошибки:
Отсутствует библиотека libxml2, точнее не сама библиотека (она может быть), а ее компоненты для разработчиков (development), для сборки программ.

Решение:
В случае CentOS нужен пакет libxml2-devel, для его установки выполните команду:
yum -y install libxml2-devel

configure: WARNING: *** Asterisk now uses SQLite3 for the internal Asterisk database.

Текст ошибки:
configure: WARNING: *** Asterisk now uses SQLite3 for the internal Asterisk database.
configure: WARNING: *** Please install the SQLite3 development package.

Описание ошибки:
Отсутствует библиотека sqlite, точнее не сама библиотека (она может быть), а ее компоненты для разработчиков (development), для сборки программ.

Решение:
В случае CentOS нужен пакет sqlite-devel:
yum -y install sqlite-devel

Doxygen is not installed

Текст ошибки:
Doxygen is not installed. Please install and re-run the configuration script.

Описание ошибки:
При установке make progdocs выдается эта ошибка. Это означает, что не удается установить документацию к asterisk, поскольку отсутствует пакет doxygen.

Решение:
Установите пакет doxygen. В CentOS выполните команду:
yum -y install doxygen

Ошибки при компиляции asterisk 12 / asterisk 13

configure: error: *** uuid support not found

Текст ошибки:
configure: error: *** uuid support not found (this typically means the uuid development package is missing)

Описание ошибки:
Отсутствует библиотека (а не пакет!) uuid, причем нужна development редакция: libuuid-devel

Решение:
В CentOS нужно поставить libuuid-devel:
yum -y install libuuid-devel

В Debian нужно поставить uuid-dev:
apt-get install uuid-dev

configure: error: *** JSON support not found

Текст ошибки:
configure: error: *** JSON support not found (this typically means the libjansson development package is missing)

Описание ошибки:
В этом случае Вам необходим пакет jansson, причем нужна development редакция: jansson-devel

Решение:
Нужно поставить jansson-devel, но в стандартных репозиториях его нет, поэтому необходимо сначала подключить дополнительный репозиторий EPEL.

После этого в CentOS нужно поставить пакет jansson-devel, выполнив команду:
yum -y install jansson-devel

В Debian нужно поставить пакет libjansson-dev, выполнив команду:
apt-get install libjansson-dev

Ошибки при запуске asterisk

Permission denied

Описание ошибки:
Asterisk не стартует (сервис запускается, но тут же останавливается, «service asterisk status» показывает «stopped». При этом в логах asterisk (/var/log/asterisk/messages) выводятся сообщения типа:
WARNING[1604] media_index.c: Failed to stat /var/lib/asterisk/sounds/en/vm-then-pound.wav: Permission denied
WARNING[1803] media_index.c: Failed to stat /var/lib/asterisk/sounds/en/vm-newpassword.wav: Permission denied
WARNING[1873] media_index.c: Failed to stat /var/lib/asterisk/sounds/en/to-report-system-network-down.wav: Permission denied

Несмотря на то, что (по умолчанию) asterisk запускается под пользователем root, имеющим полные права, отсутствует доступ к различным файлам. При этом asterisk может запускаться из командной строки (не как служба):
asterisk -vvvc
При попытке подключения к asterisk выдается ошибка:
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

Решение:
Необходимо отключить SELinux. Для этого откройте в любом редакторе файл: /etc/selinux/config и впишите/измените в нем такую строку:
SELINUX=disabled
После чего перезагрузите компьютер с asterisk.

ILLEGAL INSTRUCTION

Описание ошибки:
asterisk не стартует ни в качестве службы, ни из консоли.
Текст ошибки:
При запуске в консоли asterisk выдает сообщение Illegal instruction.

Текст ошибки:
Illegal instruction

Решение:
В данном случае собранный asterisk не поддерживает команды процессора на Вашем компьютере. Необходимо пересобрать asterisk, при этом необходимо отключить флаг BUILD_NATIVE в настройках make menuselect астериска. Для этого выполните:

  1. make menuselect
  2. выберите раздел «Compiler flags»
  3. и отключите флаг «BUILD_NATIVE»

После make menuselect не забудьте выполнить make, make install и так далее.

Источник

How to Resolve Configure: Error: no acceptable C compiler found in $PATH

Python Installation

Tried to install python 3.7.1 in Linux and met this error: «configure: error: no acceptable C compiler found in $PATH». No doubt, this error will also appear in Ubuntu and CentOS.

First of all, I downloaded the source from python official site, and then extract it.

[root@test python]# curl -O https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21.7M 100 21.7M 0 0 850k 0 0:00:26 0:00:26 —:—:— 959k
[root@test python]# tar -zxf Python-3.7.1.tgz
[root@test python]# cd *
[root@test Python-3.7.1]# mkdir mypython

Now we start to configure it to a predefined destination.

[root@test Python-3.7.1]# ./configure —prefix=$HOME/python/mypython
.
checking MACHDEP. checking for —without-gcc. no
checking for —with-icc. no
checking for gcc. no
checking for cc. no
checking for cl.exe. no
configure: error: in `/root/python/Python-3.7.1′:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details

no acceptable C compiler found in $PATH

This configuration error seemed to be related to missing or found no acceptable C compilers in $PATH. Since we are using a minimal version of Linux, it doesn’t have gcc (GNU Compiler Collection) package installed, which is a proper and suitable C compiler for make .

And what is $PATH? PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.

Since the installer found no C compiler in $PATH , a string that puts conventional binary directories together, such as /usr/bin , /usr/local/bin or /sbin , etc. to compile the source, it threw «Configure: Error: no acceptable C compiler found in $PATH» to alert users to fix the problem.

So next, I install the proper C compiler gcc by the following command and then it will appear in $PATH afterwards:

In fact, there’s a better way to pass all dependency issue like «no acceptable C compiler found in $PATH» during whole installation. That is to say, you may need all essential development tools including all kinds of supportive and acceptable compilers.

]# yum -y groupinstall «Development Tools»
.

Now we can try it again and finish the rest of the installation.

[root@test Python-3.7.1]# ./configure —prefix=$HOME/python/mypython
.
[root@test Python-3.7.1]# make
.
[root@test Python-3.7.1]# make test
.
[root@test Python-3.7.1]# make install
.
ModuleNotFoundError: No module named ‘_ctypes’
make: *** [install] Error 1

There came a message that complained about «No module named ‘_ctypes’». Now we have a library dependency problem.

libffi-devel is Required

Even if the configuration is done well and C compiler is now acceptable in $PATH, we found another issue about C compiler interface occurred during make install . In addition to C compiler, we need libffi-devel package to act as the foreign function interface for C compiler to provide ctypes and rest modules.

[root@test Python-3.7.1]# yum -y install libffi-devel
.

Let’s do it again. This time, make install found an acceptable C compiler in $PATH and worked well.

[root@test Python-3.7.1]# make install
.
Looking in links: /tmp/tmp8b7ksh64
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-10.0.1 setuptools-39.0.1

I don’t see «Configure: Error: no acceptable C compiler found in $PATH». Do you?

GeoIP Installation via PECL

Same error «no acceptable C compiler found in $PATH» occurred when installing geoip via PECL utility.

]# pecl install geoip-1.1.1
.
checking for cc. no
checking for gcc. no
configure: error: in `/var/tmp/pear-build-rootS2pmRo/geoip-1.1.1′:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details
ERROR: `/var/tmp/geoip/configure —with-php-config=/usr/bin/php-config’ failed

Although PECL is not a C compiler, it’s a utility that can assist PHP packages to be installed. During the package installation, PECL need C compiler to make source. Eventually, it cannot find any C compiler in conventional $PATH.

no acceptable C compiler found in $PATH

Same error occurred again. So I installed development tools, a package group just like the above solution in python installation.

]# yum -y groupinstall «Development Tools»
.

]# pecl install geoip-1.1.1
downloading geoip-1.1.1.tgz .
Starting to download geoip-1.1.1.tgz (13,004 bytes)
.
checking for geoip files in default path. not found
configure: error: Please reinstall the geoip distribution
ERROR: `/var/tmp/geoip/configure —with-php-config=/usr/bin/php-config’ failed

It still failed, but it’s not about «no acceptable C compiler found in $PATH». It’s about geoip-1.1.1.

geoip-1.1.1 is Required

No such «Configure: Error: no acceptable C compiler found in $PATH» this time. But we have another error which told us to install a proper package called geoip-devel first.

]# yum -y install geoip-devel
.

Then I tried to make it right again.

]# pecl install geoip-1.1.1
downloading geoip-1.1.1.tgz .
Starting to download geoip-1.1.1.tgz (13,004 bytes)
.
Build process completed successfully
Installing ‘/usr/lib64/php/modules/geoip.so’
install ok: channel://pecl.php.net/geoip-1.1.1
configuration option «php_ini» is not set to php.ini location
You should add «extension=geoip.so» to php.ini

This time, we’re good.

As for Debian or its variants, you can run the equivalent command: sudo aptitude install build-essential
to solve the configuration error.

In conclusion, the lesson I learned from this error «no acceptable C compiler found in $PATH» is that we should know and install all dependencies of configuration packages before installing python and geoip. In this case, we need an acceptable C compiler found in $PATH in order to make install all kinds of sources.

Источник

Do you get an error “no acceptable C compiler found” while compiling OpenCA from source? If yes, here’s a fix for it.

configure: error: in `/home/openra/openca-base-1.5.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Fix compilation error : no acceptable C compiler found in $PATH

The error is due to missing C compiler or the compilation script could not find one in $PATH variable. So the first thing is to check if you have C compiler installed. In most cases, it will be GNU C compiler.

Run the below command to check if you have GCC installed.

$ rpm -qa | grep gcc

Don’t have one? Then install GCC using the below command.

Pre-requisites:

You need root privileges to install GCC.

How to install GCC on RHEL/CentOS/Ubuntu/Debian

RHEL/CentOS

# yum install gcc

Ubuntu/Debian:

# apt-get install gcc

Once you install, run the below command:

RHEL/CentOS:

# yum groupinstall "Development tools"

Ubuntu/Debian:

# apt-get install build-essential

Install from source: (Ignore this step, if you chose to install via yum/apt-get)

You can also compile GCC from source and install it.

Now the GCC is installed, try compiling OpenCA. In case, if you choose to install GCC from source, then make sure the path of gcc is set in the environment variable.

# export PATH=$PATH:<gcc command path>

Conclusion:

If you ever get an error ‘no acceptable C compiler found’ while compiling OpenCA or any package, then the issue can be fixed by installing a C compiler (GCC or any appropriate compiler) and setting the path of the compiler in environment variable.

Hope it helps.

Author Profile

Ramya Santhosh

is a Web Designer and content creator. A freelance writer on latest trends in technology, gadget reviews, How to’s and many more.

I am trying to install GCC from source. I am following the instructions on the wiki at https://gcc.gnu.org/wiki/InstallingGCC and also on this question on SO.
I am running into issues on the configure step when running:

$PWD/../gcc-4.6.2/configure --prefix=$HOME/gcc-4.6.2

I get the following output and error:

checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for libatomic support... yes
checking for libcilkrts support... no
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libmpx support... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/bin/objdir':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

I appears as if the error is because there is no C compiler installed. This confuses me because isn’t installing a C compiler what installing GCC is supposed to do? All the solutions I can find for this error say that I need to install GCC, so how can I install GCC if I need GCC installed to do it?

I have updated my $PATH variable using export PATH=$PATH:/usr/bin/gcc-4.6.2 but it didn’t help. I have also looked at this similar question without success: https://unix.stackexchange.com/questions/310669/c-compiler-while-installing-gcc

Is there something I am missing? What else can I do to get GCC installed?

NOTE: I can’t just use yum or apt-get to install it because I am using a custom distribution that does not have those type of installer software installed.

Installing Apache HTTP is always fun. A few days back, I was installing Apache 2.4 on CentOS VM and encountered multiple errors.

I thought it would be helpful to put together for a reference.

APR not found

[root@chandan httpd-2.4.25]# ./configure --enable-ssl
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... no
configure: error: APR not found.  Please read the documentation.
[root@chandan httpd-2.4.25]#

APR stands for “Apache Portable Runtime” and needed to compile from the source. If you are in the same situation as me then following will rescue you.

First, you need to install APR.

  • Download the latest version of APR using wget
wget https://www-eu.apache.org/dist/apr/apr-1.6.3.tar.gz .
  • Extract the downloaded file
gunzip -c apr-1.6.3.tar.gz | tar xvf -
  • it will create a new folder “apr-1.6.3
  • Go inside and compile with configure command
./configure

It will take a few seconds and once done you will get a prompt back (ensure no error).

  • The last step would be to install using make command
make
make install

Once done, I tried installing Apache and got another error.

APR-util not found

[root@chandan httpd-2.4.25]# ./configure --enable-ssl --enable-so
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.
[root@chandan httpd-2.4.25]#

In case you have “APR-util not found” error as well then you got to install the following.

  • Download the latest APR-util source
wget https://www-eu.apache.org/dist/apr/apr-util-1.6.1.tar.gz .
  • Extract the downloaded gz file
gunzip -c apr-util-1.6.1.tar.gz | tar xvf -
  • Go inside the newly created folder “apr-util-1.6.1” and install using the following commands
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make
make install

Tried installing Apache again and got another error.

pcre-config for libpcre not found

This is what I got.

checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

PCRE stands for Perl Compatible Regular Expressions, and this error got an easy solution. You just to install pcre-devel package.

yum install pcre-devel

Not over yet, got another in next attempt related to OpenSSL.

OpenSSL version is too old

checking whether to enable mod_slotmem_plain... no
checking whether to enable mod_ssl... checking dependencies
checking for OpenSSL... checking for user-provided OpenSSL base directory... ./configure: line 25426: cd: /usr/bin/openssl: Not a directory
/root/httpd-2.4.25
  adding "-I/root/httpd-2.4.25/include" to CPPFLAGS
  setting MOD_CFLAGS to "-I/root/httpd-2.4.25/include"
  setting ab_CFLAGS to "-I/root/httpd-2.4.25/include"
  adding "-L/root/httpd-2.4.25/lib" to LDFLAGS
  setting MOD_LDFLAGS to "-L/root/httpd-2.4.25/lib"
checking for OpenSSL version >= 0.9.8a... FAILED
configure: WARNING: OpenSSL version is too old
no
checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures
[root@chandan httpd-2.4.25]#

The first thing you have to ensure you have the latest version of OpenSSL which was in my case, so I needed to install the devel package, and it was all right.

yum install openssl-devel

xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory

While compiling APR, I got this error.

[root@instance-1 apr-util-1.6.1]# make
make[1]: Entering directory `/opt/temp/apr-util-1.6.1'
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/opt/temp/apr-util-1.6.1/include -I/opt/temp/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
 #include <expat.h>
                   ^
compilation terminated.
make[1]: *** [xml/apr_xml.lo] Error 1

If you are getting this error, then this can be resolved by installing expat-devel package.

yum install expat-devel

configure: error: no acceptable C compiler found in $PATH

C compiler not found is typical for any software build, and you can fix this by installing the compiler.

yum install gcc

nghttp2 version is too old

This is specific to when you try to install Apache with HTTP/2. You will get the following error.

checking whether to enable mod_http2... checking dependencies
checking for OpenSSL... (cached) yes
  setting MOD_LDFLAGS to "  -lssl -lcrypto -lrt -lcrypt -lpthread"
  setting MOD_CFLAGS to " "
  setting MOD_CPPFLAGS to "-DH2_OPENSSL"
checking for nghttp2... checking for user-provided nghttp2 base directory... none
checking for pkg-config along ... checking for nghttp2 version >= 1.2.1... FAILED
configure: WARNING: nghttp2 version is too old
no
checking whether to enable mod_http2... configure: error: mod_http2 has been requested but can not be built due to prerequisite failures

And, if so, you can fix by installing nghttp2 as below.

  • Download the latest version of nghttp2 from here
wget https://github.com/nghttp2/nghttp2/releases/download/v1.37.0/nghttp2-1.37.0.tar.gz
  • Extract the downloaded file
tar -xvf nghttp2-1.37.0.tar.gz
  • It will create a new folder, go inside that and run the following
./configure
make
make install

Once done without error, run the Apache source build with HTTP2 again. It should be alright.

Finally, I was able to install Apache successfully. If you are interested in learning about Apache HTTP Server Administration, then check out this online course.

Понравилась статья? Поделить с друзьями: