Home Backend Development PHP Tutorial Common errors and solutions for PHP source code installation_PHP tutorial

Common errors and solutions for PHP source code installation_PHP tutorial

Jul 20, 2016 am 11:17 AM
error php and Method Install common source code solve mistake

Error: configure: error: libevent >= 1.4.11 could not be found

Solution: yum -y install libevent libevent-devel



Error: configure: error: Please reinstall the mysql distribution

Solution: yum -y install mysql-devel



Error: make: *** [sapi/fpm/php-fpm] error 1

Solution: compile with make ZEND_EXTRA_LIBS='-liconv'



Error: configure: error: XML configuration could not be found

Solution: yum -y install libxml2 libxml2-devel



Error: configure: error: No curses/termcap library found

Solution: yum -y install ncurses ncurses-devel



Error: configure: error: xml2-config not found

Solution: yum -y install libxml2 libxml2-devel



Error: configure: error: Cannot find OpenSSL's

Solution: yum install openssl openssl-devel



Error: configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/

Solution: yum install curl curl-devel



Error: configure: error: Cannot find ldap.h

Solution: yum install openldap openldap-devel



Error: configure: error: libjpeg.(a|so) not found

Solution: yum install libjpeglibjpeg -devel



Error: configure: error: libpng.(a|so) not found.

Solution: yum install libpnglibpng –devel



Error: configure: error: freetype.h not found.

Solution: yum install freetype-devel



Error: configure: error: cannot find output from lex; giving up

Solution: yum -y install flex



Error: configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

Solution: yum -y install zlib-devel openssl-devel



Error: Configure: error: Unable to locate gmp.h

Solution: yum install gmp-devel



Error: Configure: error: Cannot find MySQL header files under /usr.

Note that the MySQL client library is not bundled anymore!

Solution: yum install mysql-devel

More supplementary content:

Install php: ./configure
configure: error: XML configuration could not be found

yum -y install libxml2 libxml2-devel

Cannot find OpenSSL's
yum install openssl openssl-devel

1) Configure: error: xml2-config not found. Please check your libxml2 installation.
#yum install libxml2 libxml2-devel (For RedHat & Fedora)
# aptitude install libxml2-dev (For Ubuntu)

2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's
#yum install openssl openssl-devel

3) Configure: error: Please reinstall the BZip2 distribution
# yum install bzip2 bzip2-devel

4) Configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
# yum install curl curl-devel (For RedHat & Fedora)
# install libcurl4-gnutls-dev (For Ubuntu)

5) Configure: error: libjpeg.(also) not found.
# yum install libjpeg libjpeg-devel

6) Configure: error: libpng.(also) not found.
# yum install libpng libpng-devel

7) Configure: error: freetype.h not found.
#yum install freetype-devel

8) Configure: error: Unable to locate gmp.h
# yum install gmp-devel

9) Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
# yum install mysql-devel (For RedHat & Fedora)
# apt-get install libmysql++-dev (For Ubuntu)

10) Configure: error: Please reinstall the ncurses distribution
# yum install ncurses ncurses-devel

11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
# yum install unixODBC-devel

12) Configure: error: Cannot find pspell
# yum install pspell-devel

13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
# yum install libmcrypt libmcrypt-devel (For RedHat & Fedora)
# apt-get install libmcrypt-dev

14) Configure: error: snmp.h not found. Check your SNMP installation.
# yum install net-snmp net-snmp-devel

15)
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
# yum install libtool-ltdl.x86_64 libtool-ltdl-devel.x86_64

16)
When compiling the xcache module for php, you need to run phpize
Got an error
#/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
This can be solved by installing autoconf
Execute yum install autoconf under centos
Under Ubuntu, execute apt-get install autoconf
17)
# /usr/local/php/bin/phpize
Cannot find config.m4.
Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module
Modification method:
[root@centos lnmp]# cd php-5.2.14ext/
[root@centos ext]# ./ext_skel --extname=my_module
Creating directory my_module
Creating basic files: config.m4 config.w32 .cvsignore my_module.c php_my_module.h CREDITS EXPERIMENTAL tests/001.phpt my_module.php [done].
To use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/my_module/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-my_module
5. $ make
6. $ ./php -f ext/my_module/my_module.php
7. $ vi ext/my_module/my_module.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/my_module/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.
[root@centos ext]# cd my_module/
[root@centos my_module]# vim config.m4
According to your own choice, place
dnl PHP_ARG_WITH(my_module, for my_module support,
dnl Make sure that the comment is aligned:
dnl [ --with-my_module Include my_module support])
Modify to
PHP_ARG_WITH(my_module, for my_module support,
Make sure that the comment is aligned:
[ --with-my_module Include my_module support])
Or replace
dnl PHP_ARG_ENABLE(my_module, whether to enable my_module support,
dnl Make sure that the comment is aligned:
dnl [ --enable-my_module Enable my_module support])
Modify to
PHP_ARG_ENABLE(my_module, whether to enable my_module support,
Make sure that the comment is aligned:
[ --enable-my_module Enable my_module support])
[root@centos my_module]# vim my_module.c
Modify the following code in the file
/* Every user visible function must have an entry in my_module_functions[].
*/
function_entry my_module_functions[] = {
PHP_FE(say_hello,  NULL) /* ?Add a line of code */
PHP_FE(confirm_my_module_compiled, NULL) /* For testing, remove later. */
{NULL, NULL, NULL}  /* Must be the last line in my_module_functions[] */
};
Add the following code at the end of the file
PHP_FUNCTION(say_hello)
{
zend_printf("hello sdomain!");
}
Modify again: php_sdomain.h
vi php_sdomain.h
Add a line below the line PHP_FUNCTION(confirm_my_module_compiled); /* For testing, remove later. */:
PHP_FUNCTION(say_hello); /* For testing, remove later. */
Save file and exit
Then we can use the above command in this directory
/usr/local/php/bin/phpize
After execution, you will see the following
[root@ns sdomain]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:   20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
[root@ns sdomain]#
Then execute ./configure --with-php-config=/usr/local/php/bin/php-config
Then execute make
make install
Then he will generate the corresponding so file and put it in a folder under the PHP installation directory, and prompt where it is, and then copy the SO file inside to the place where you store the SO file
That is, the location specified by extension_dir in php.ini
The final step is for you to open the extension in your php.ini file
extension=sdomain.so
Then
Restart apache

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/372035.htmlTechArticle错误:configure: error: libevent = 1.4.11 could not be found 解决:yum -y install libevent libevent-devel 错误:configure: error: Please reinstall the mysql distributio 解决...
Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles