Php source code installation common errors and solutions _ PHP Tutorial

Source: Internet
Author: User
Tags gmp sapi
Php source code installation common errors and solutions. Error: configure: error: warn solution: yum-yinstalllibeventlibevent-devel error: configure: error: Pleasereinstallthemysqldistributio solution error: configure: error: libevent> = 1.4.11 cocould not be found

Solution: yum-y install libevent-devel



Error: configure: error: Please reinstall the mysql distributio

Solution: yum-y install mysql-devel



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

Solution: Use make ZEND_EXTRA_LIBS = '-liconv' to compile



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

Fix: yum-y install libxml2 libxml2-devel



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

Solution: yum-y install ncurses-devel



Error: configure: error: xml2-config not found

Fix: yum-y install libxml2 libxml2-devel



Error: configure: error: Cannot find OpenSSL's

Solution: yum install openssl-devel



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

Solution: yum install curl-devel



Error: configure: error: Cannot find ldap. h

Solution: yum install openldap-devel



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

Solution: yum install lib1_libjpeg-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 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 cocould not be found

Yum-y install libxml2 libxml2-devel

Cannot find OpenSSL's
Yum install openssl-devel

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

2) Checking for pkg-config... /Usr/bin/pkg-config
Configure: error: Cannot find OpenSSL's
# Yum install 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 shoshould be in /Include/curl/
# Yum install curl-devel (For RedHat & Fedora)
# Install libcurl4-gnutls-dev (For Ubuntu)

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

6) Configure: error: libpng. (also) not found.
# Yum install 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-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-devel (For RedHat & Fedora)
# Apt-get install libmcrypt-dev

14) Configure: error: snmp. h not found. Check your SNMP installation.
# Yum install 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)
Run phpize when compiling the xcache module for php.
An error is returned.
#/Usr/local/php/bin/phpize
Processing ING:
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.
You can solve this problem by installing autoconf.
Run yum install autoconf in centos.
Run apt-get install autoconf in Ubuntu.
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] # D 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
Choose
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
PHP_ARG_WITH (my_module, for my_module support,
Make sure that the comment is aligned:
[-- With-my_module Include my_module support])
Or set
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
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 php_sdomain.h.
Vi php_sdomain.h
Add a row under the PHP_FUNCTION (confirm_my_module_compiled);/* For testing, remove later. */line:
PHP_FUNCTION (say_hello);/* For testing, remove later .*/
Save the 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
Processing ING:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
[Root @ ns sdomain] #
Then run./configure -- with-php-config =/usr/local/php/bin/php-config.
Then execute make
Make install
Then he will put the corresponding so file generation in a folder under the PHP installation directory, and prompt where it is, and then copy the SO file to the place where you store the SO file.
That is, the location specified by extension_dir in php. ini.
The last step is to open the extension in the php. ini file.
Extension = sdomain. so
Then
Restart apache

Warning error: libevent = 1.4.11 cocould not be found solution: yum-y install libevent-devel error: configure: error: Please reinstall the mysql distributio solution...

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.