Various problems with installing PHP under Linux

Source: Internet
Author: User
Tags gmp ldap mysql client snmp xslt openldap

1. First unzip, then configure, the following is my configure parameter

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-mysql=/usr/-- With-mysqli=/usr/bin/mysql_config--with-mysql-sock=/tmp/mysql.sock--enable-fpm--enable-sockets--enable-FTP --enable-mbstring--enable-zip --enable-exif--enable-soap--enable-gd-native-ttf--enable-mbregex-- Disable-ipv6--with-fpm-user=www--with-fpm-group=www--with-libxml-dir --with-mhash--with-gd--with-jpeg- dir --with-png-dir --with-freetype-dir --with-zlib-dir --with-mcrypt-- With-pear--with-curl--with-openssl  --with-iconv-dir --enable-pcntl

Note: MySQL is installed via rpm, in/usr/bin/mysql

2. The installation process has occurred in a variety of libraries do not exist, so first executed the following script, install a variety of libraries

sudo -slang=Cyuminstallgccgccbzip2  bzip2-devel ncurses ncurses-devel Curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel Open SSL Openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

3.configure:error:cannot Find Libmysqlclient under/usr/. Note that the MySQL client library isn't bundled anymore!

Workaround: Find libmysqlclient.so

Find " libmysqlclient* "/usr/lib64/mysql/libmysqlclient.a/usr/lib64/libmysqlclient.so. 18.0. 0

Then resume the soft chain:

Ln -s/usr/lib64/libmysqlclient.so. 18.0. 0 /usr/lib/libmysqlclient.so

4.configure:error:cannot find MySQL header files Under/usr/bin/mysql This is probably the wrong path to fill in MySQL

Workaround: Modify compile-time parameters MySQL path with-mysql=/usr/

5. Here are some common error messages that others have collated

Some of the following error messages are sometimes encountered in the CentOS compilation PHP5, which can basically be solved by using Yum to install the appropriate libraries. Here are some specific workarounds:

Checking for BZIP2 support ... yes checking for BZIP2 in default path ... not found configure:error:Please reinstall the BZIP2 Distribution

Fix:yum install bzip2-devel

Checking for Curl support ... yes checking if we should use the Curl for URL streams ... no checking for curl in default path ... not f Ound configure:error:Please Reinstall the Libcurl distribution–easy.h should be in/include/curl/

Fix:yum install curl-devel

Checking for Curl_multi_strerror In-lcurl ... yes checking for qdbm support ... no checking for gdbm support ... no checking for N DBM support ... no configure:error:DBA:Could not find necessary header file (s).

Fix:yum install db4-devel

Checking for FABSF ... yes checking for Floorf ... yes configure:error:jpeglib.h not found.

Fix:yum install libjpeg-devel

Checking for FABSF ... yes checking for Floorf ... yes checking for Jpeg_read_header in-ljpeg ... yes configure:error:png.h not Found.

Fix:yum install libpng-devel

Checking for png_write_image in-lpng ... yes If configure fails try–with-xpm-dir=

Configure:error:freetype.h not found.

Fix: Reconfigure your PHP with the following option.--with-xpm-dir=/usr yum install freetype-devel

Checking for png_write_image in-lpng ... yes configure:error:libXpm. (A|SO) not found.

Fix:yum install libXpm-devel

Checking for Bind_textdomain_codeset in-lc ... yes checking for GNU MP support ... yes configure:error:Unable to locate Gmp.h

Fix:yum install gmp-devel

Checking for Utf8_mime2text signature ... new checking for u8t_decompose ... configure:error:utf8_mime2text () has new Signatur E, but u8t_canonical is missing. This should is not happen. Check Config.log For additional information.

Fix:yum install libc-client-devel

Checking for LDAP support ... yes, shared checking for LDAP Cyrus SASL support ... yes Configure:error:Cannot find Ldap.h

Fix:yum install openldap-devel

Checking for Mysql_set_character_set in-lmysqlclient ... yes checking for Mysql_stmt_next_result in-lmysqlclient ... no Checki ng for Oracle Database OCI8 support ... no checking for UnixODBC support ... configure:error:ODBC header file '/usr/include/sq Lext.h ' Not found!

Fix:

yum install unixODBC-devel

Checking for PostgreSQL support for PDO ... yes, shared checking for pg_config ... not found Configure:error:Cannot find LIBPQ -fe.h. Please specify correct PostgreSQL installation path

Fix:yum install postgresql-devel

Checking for SQLite 3 support for PDO ... yes, shared checking for PDO includes ... (cached)/usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path ... not found Configure:error:Please reins Tall the sqlite3 distribution

Fix:yum install sqlite-devel

Checking for utsname.domainname ... yes checking for Pspell support ... yes Configure:error:Cannot find Pspell

Fix:yum install aspell-devel

Checking whether to enable UCD SNMP hack ... yes checking for default_store.h ... no

Checking for Kstat_read in-lkstat ... no checking for snmp_parse_oid in-lsnmp ... no checking for Init_snmp in-lsnmp ... no conf Igure:error:SNMP sanity check failed. Please check the Config.log for more information.

Fix:yum install net-snmp-devel

Checking whether to enable XMLWriter support ... yes, shared checking for Xml2-config path ... (cached)/usr/bin/xml2-config checking whether Libxml build works ... (cached) Yes checking for XSL support ... yes, shared configure:error:xslt-config not found. Please reinstall the LIBXSLT >= 1.1.0 distribution

Fix:yum install libxslt-devel

Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Fix:yum install libxml2-devel

Checking for PCRE headers location ... configure:error:Could not find pcre.h in/usr

Fix:yum install pcre-devel

Configure:error:Cannot find MySQL header files under Yes. Note that the MySQL client library isn't bundled anymore!

Fix:yum install mysql-devel

Checking for UnixODBC support ... configure:error:ODBC header file '/usr/include/sqlext.h ' not found!

Fix:yum install unixODBC-devel

Checking for pg_config ... not found Configure:error:Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

Fix:

yum install postgresql-devel

Configure:error:Cannot Find Pspell

Fix:yum install pspell-devel

Configure:error:Could not find Net-snmp-config binary. Please check your NET-SNMP installation.

Fix:yum install net-snmp-devel

Configure:error:xslt-config not found. Please reinstall the LIBXSLT >= 1.1.0 distribution

Fix:yum install libxslt-devel

Compile and install Pdo_mysql Extension module, always prompt

1234567 In fileincluded from /data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: error: mysql.h: No such fileor directoryIn fileincluded from /data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36: error: expected specifier-qualifier-list before ‘MYSQL’/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48: error: expected specifier-qualifier-list before ‘MYSQL_FIELD’/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before ‘MYSQL_RES’make: *** [pdo_mysql.lo] Error 1

This is because this is a file that requires MySQL's header at compile time. This problem occurs because it does not find the location of the header file by default search. The MySQL header file is mapped to/usr/local/include/via a soft connection.

For example, if your MySQL installation file is located in/usr/local/mysql, then execute the following command:

# ln-s/usr/local/mysql/include/*/usr/local/include/

Various problems with installing PHP under Linux

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.