This article mainly introduces some common problems that may occur during the installation of php through source code on linux server, and shares it with a friend in need: 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
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
The above errors are all problems encountered during the entire compilation and installation. then, combine the online materials to find the solution and summarize it to this point, hoping to help you!
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.