PHP Source code installation common errors and solutions to share

Source: Internet
Author: User
Tags gmp install openssl php source code sapi save file 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 being 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 be 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

FIX: Yum-y Install Flex



Error: Configure:error:mod_deflate have been requested but can is not being 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 isn't bundled anymore!

Solution: Yum Install Mysql-devel

Additional content:

Install PHP:./configure
Configure:error:XML configuration could not being 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 is 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.
Note that the MySQL client library isn't bundled anymore!
# Yum Install Mysql-devel (for RedHat & Fedora)
# Apt-get Install Libmysql++-dev (for Ubuntu)

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

One) 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 the XCache module 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.
By installing autoconf, you can resolve
Execute yum install autoconf under CentOS
Perform apt-get install autoconf under Ubuntu
17)
#/usr/local/php/bin/phpize
Cannot find CONFIG.M4.
Make sure this you run '/usr/local/php/bin/phpize ' in the top level source directory of the module
Modification Method:
[Email protected] lnmp]# CD php-5.2.14ext/
[Email protected] 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 and 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 is 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 steps as often as necessary.
[Email protected] ext]# CD my_module/
[Email protected] my_module]# vim CONFIG.M4
Depending on your own choice, you will
DNL Php_arg_with (My_module, for my_module support,
DNL Make sure, the comment is aligned:
DNL [--with-my_module Include my_module support])
Modified into
Php_arg_with (My_module, for my_module support,
Make sure, the comment is aligned:
[--with-my_module Include my_module support])
or the
DNL php_arg_enable (My_module, whether to ENABLE my_module support,
DNL Make sure, the 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, the comment is aligned:
[--enable-my_module enable my_module support])
[Email protected] my_module]# vim my_module.c
Modify the following code in the file
/* Every user visible function must 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!");
}
Again 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
And then we can use the above command in this directory.
/usr/local/php/bin/phpize
You will see the following after execution
[Email protected] sdomain]#/usr/local/php/bin/phpize
Configuring for:
PHP Api version:20020918
Zend Module Api no:20020429
Zend Extension Api no:20050606
[Email protected] sdomain]#
Then execute the./configure--with-php-config=/usr/local/php/bin/php-config
Then execute make
Make install
Then he will put the corresponding so file into a folder under the PHP installation directory, and indicate where, and then copy the so file into the place where you stored so files.
The position you specified in the Extension_dir of the php.ini.
The final step is that you open this extension in the php.ini file
Extension=sdomain.so
And then
Re-starting Apache

The above errors are in the entire compilation installation encountered problems, and then combined with the information on the Internet, find the solution, summed up to this place, hope to help everyone!

PHP Source code installation common errors and solutions to share

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.