PHP Source code installation common errors and solutions sharing _php tips

Source: Internet
Author: User
Tags fpm gmp install php mysql client openssl snmp openldap zend
Error: Configure:error:libevent >= 1.4.11 could not being found

Solution: Yum-y Install libevent Libevent-devel



Error: Configure:error:Please Reinstall the MySQL Distributio

Solution: Yum-y Install Mysql-devel



Error: Make: * * * [SAPI/FPM/PHP-FPM] Error 1

FIX: Compile with make zend_extra_libs= '-liconv '



Error: Configure:error:XML configuration could not to 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 <evp.h>

Solution: Yum Install OpenSSL openssl-devel



Error: Configure:error:Please Reinstall the Libcurl distribution-easy.h should is in <curl-dir>/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: Onfigure: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 is 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.

The MySQL client library is not bundled anymore!

Solution: Yum Install Mysql-devel

More Supplemental content:

Install PHP:./configure
Configure:error:XML configuration could not to be found

Yum-y Install LIBXML2 Libxml2-devel

Cannot find OpenSSL ' s <evp.h>
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 <evp.h>
#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 <curl-dir>/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.
The MySQL client library is not bundled anymore!
# Yum Install Mysql-devel (for RedHat & Fedora)
# Apt-get Install Libmysql++-dev (for Ubuntu)

Configure:error:Please Reinstall the ncurses distribution
# yum Install ncurses Ncurses-devel

Checking for UNIXODBC support ... configure:error:ODBC header file '/usr/include/sqlext.h ' not found!
# yum Install Unixodbc-devel

Configure:error:Cannot Find Pspell
# yum Install Pspell-devel

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
# yum Install Libmcrypt libmcrypt-devel (for RedHat & Fedora)
# Apt-get Install Libmcrypt-dev

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 XCache modules for PHP, you need to run Phpize
Got a mistake
#/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.
Autoconf can be resolved by installing
CentOS Execute yum Install autoconf
Ubuntu under the executive Apt-get install autoconf can be
17)
#/usr/local/php/bin/phpize
Cannot find CONFIG.M4.
Make sure so you run '/usr/local/php/bin/phpize ' in ' the '
To modify the 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'll 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 the 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, you will
DNL Php_arg_with (My_module, for my_module support,
DNL Make sure this comment is aligned:
DNL [--with-my_module Include my_module support])
Modified into
Php_arg_with (My_module, for my_module support,
Make sure this comment is aligned:
[--with-my_module Include my_module support])
or to
DNL php_arg_enable (My_module, whether to ENABLE my_module support,
DNL Make sure this comment is aligned:
DNL [--enable-my_module enable my_module support])
Modified into
Php_arg_enable (My_module, whether to ENABLE my_module support,
Make sure this 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 a 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 is 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!");
}
Re-modified: Php_sdomain.h
VI Php_sdomain.h
In Php_function (confirm_my_module_compiled); /* For testing, remove later. * * Add a line below this line:
Php_function (Say_hello); /* For testing, remove later. */
Save File 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]#
And then execute./configure--with-php-config=/usr/local/php/bin/php-config
Then execute make
Make install
He then puts the corresponding so file into a folder under the PHP installation directory, and prompts where it is, and then copies the inside so file to the place where you store the so file.
The position you specified in the Extension_dir inside the php.ini.
The final step is that you open this extension in the php.ini file.
Extension=sdomain.so
And then
Restart Apache

The above errors are in the entire compilation of installation problems encountered, and then combined with the online data, find solutions, summed up to this place, hoping to help everyone!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.