Compile and install PHP in Ubuntu

Source: Internet
Author: User
Tags mcrypt php development environment
Let's stop talking about how to get the php source code and decompress it In Ubuntu. The compilation parameters are :. /configure -- prefix =/opt/php -- with-bz2 -- with-mcrypt -- with-mhash -- with-openssl -- with-pdo-mysql -- with-pdo-pgsql -- w

Let's stop talking about how to get the php source code and decompress it In Ubuntu.

The compilation parameters are:

. /Configure -- prefix =/opt/php -- with-bz2 -- with-mcrypt -- with-mhash -- with-openssl -- with-pdo-mysql -- with-pdo-pgsql -- with-mysqli -- with-pgsql -- enable-calendar -- with-gettext -- with-iconv -- enable-mbstring -- with-pspell -- enable-exif -- with-gd -- with-png-dir =/opt /php -- with-jpeg-dir =/opt/php -- with-imap -- enable-bcmath -- with-gmp -- enable-pcntl -- enable-sysvshm -- enable-shmop --- tidy -- with-curl -- enable-ftp -- with-ldap -- enable-sockets -- enable-fpm -- enable-soap -- with-xmlrpc -- enable-wddx -- with-xsl --- kerberos -- with-imap-ssl

The value of the -- prefix parameter specifies the php installation path. If this parameter is not specified, the php files will be scattered in various places after installation, which is not conducive to management, all PHP files stored in the specified path are stored in the specified path. All other parameters can be found in the php manual. You only need to view the required parameters by referring to the installation instructions for each extension in the function reference section. These parameters can be increased or decreased as needed. If you need to add an extension later, you only need to add new extension parameters to the original parameters and re-compile and install them (as long as the -- prefix parameter location remains unchanged, You can overwrite the previously installed php ).

After compilation, run the make command. After the make command is executed, run the sudo make install command to install it.

During the installation process, you may encounter various problems, such as missing dependency packages. The problems encountered during the installation process are as follows:

Configure: error: utf8_mime2text () has new signature, but U8T_CANONICAL is missing. this shoshould not happen. check config. log for additional information solution: apt-get install libc-client2007e-dev configure: error: Cannot find ldap libraries in/usr/lib. solution: ln-fs/usr/lib/x86_64-linux-gnu/libldap. so/usr/lib/configure: error: mcrypt. h not found. please reinstall libmcrypt. solution: sudo apt-get install Libmcrypt-dev CONFIGURE: ERROR: cannot find LIBPQ-FE.H. please specify correct postgresql installation path solution: sudo apt-get install postgresql-server-dev-9.5 configure: error: Cannot find pspell solution: sudo apt-get install libpspell-dev configure: error: cannot find libtidy solution: sudo apt-get install libtidy-dev configure: error: xslt-config not found. please reinstall the libxslt> = 1.1.0 distrib Ution solution: sudo apt-get install libxslt1-dev/usr/bin/ld: ext/ldap /. libs/ldap. o: undefined reference to symbol'ber _ strdup @ OPENLDAP_2.4_2 '// usr/lib/x86_64-linux-gnu/ error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusmake: *** [sapi/cli/php] Error 1 solution: Find the EXTRA_LIBS row (with many parameters) in vim Makefile in the PHP source code directory ), add '-llber' at the end of the row to save and exit make again. The above is only a part of the problems encountered, Because I encountered some problems during the installation is not recorded, so currently only these problems, the next installation will be added.

Deep understanding of ini configuration in PHP

Analysis of PHP script timeout mechanism

Ubuntu 14.04 PHP development environment under the establishment of PDF

PHP 7 innovative and performance optimization

PHP 7, you deserve a

Experience the PHP 7.0 on CentOS 7.x/Fedora 21

CentOS 6.3 install LNMP (PHP 5.4, MyySQL5.6)

Http:// of two problems with Nginx startup failure when deploying LNMP

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)

Php hd scan PDF + CD source code + a full set of teaching video

Development Environment for configuring php lnmp in CentOS 6

PHP details: Click here
PHP: Click here

This article permanently updates the link address: Http://

Related Article

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: 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.