PHP5.3.27 and MySQL are separately installed on two machines

Source: Internet
Author: User
PHP5.3.27 and MySQL are separately installed on the two machines c67 + php5.3.27

Php and mysql are installed on the same machine: an error is reported during php compilation.


Prerequisites: install php dependencies as follows:

Installation preparation:

Yum install zlib libxml libjpeg freetype libpnggd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devellibpng-devel gd-devel curl-devel yyum install curl-devel y # execute this again, the above copy amount may cause not to be installed

Epel installation (5 packages can be installed)

Wget-O/etc/yum. repos. d/epel. repo http://mirrors.aliyun.com/repo/epel-6.repoyum install libxslt-devel �y # This seems to be unable to install, it uses the source code installation (163 source) yum install libmcrypt-devel mhash-devel mcrypt-y


When compiling php, the following error is reported:

# make。。。/usr/bin/ld: cannot find -lltdlcollect2: ld returned 1 exit statusmake: *** [libphp5.la] Error 1


Cause:

This problem is generally caused by the failure to find the library file when the ld connects to the database:

Solution:

Method 1:

When this problem occurs, go to the lib directory to find the relevant library files, basically as follows:

[root@localhost ~]# cd  /usr/lib[root@localhost lib]# ll | grep libltdllrwxrwxrwx   1 root root       16 Nov 14 22:40 libltdl.so.3 -> libltdl.so.3.1.4-rwxr-xr-x   1 root root    25484 Dec 16  2009 libltdl.so.3.1.4

The above library file does not have a library entry: libltdl. so

You can manually establish a connection to solve the problem:

# ln -s  ./libltdl.so.3   ./libltdl.so

Method 2: Basic solution

However, this problem should be due to the fact that the library's header file library is not installed:

[root@localhost lib]# yum list all | grep ltdllibtool-ltdl.i386                       1.5.22-7.el5_4              installed   libtool-ltdl-devel.i386                 1.5.22-7.el5_4              CentOs5.5-32

Installation header file:

[root@localhost lib]# yum -y install libtool-ltdl-devel.i386

The error is indeed caused by the uninstalled devel header file.

[root@localhost lib]# rpm -ql libtool-ltdl-devel.i386/usr/include/ltdl.h/usr/lib/libltdl.a/usr/lib/libltdl.la/usr/lib/libltdl.so

OK. solve the problem ~

View URL:

Http://www.linuxquestions.org/questions/linux-software-2/make-error-usr-bin-ld-cannot-find-lxext-365646/


Appendix: The configure parameter of PHP5.3.27 during PHP and MySQL separate installation:

./configure \--prefix=/application/php-5.3.27 \--with-mysql=mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-iconv-dir=/usr/local/libiconv \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \--with-libxml-dir=/usr \--enable-mysqlnd \--enable-xml \--enable-safe-mode \--disable-rpath \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--with-curl \--with-curlwrappers \--enable-mbregex \--enable-fpm \--enable-mbstring \--with-mcrypt \--with-gd \--enable-gd-native-ttf \--with-openssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-zip \--enable-soap \--enable-short-tags \--enable-zend-multibyte \--enable-static \--with-xsl \--with-fpm-user=nginx \--with-fpm-group=nginx \--enable-ftp

After configure is executed, run yum install. before make:

Method 1: Nima. I installed PHP and MySQL separately without the mysql path.

ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/touch ext/phar/phar.phar

Method 2:

echo "/application/mysql/lib">>/etc/ld.so.confldconfig

Method 3: This is the solution to the error reported in this article.

Method 3: php and mysql are isolated from each other.

yum list all | grep ltdlyum install libtool-ltdl-devel.x86_64libtool-ltdl.x86_64 �y
make && make installln -s /application/php-5.3.27/ /application/php

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.