error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

Windows服務器Azure雲編譯安裝MariaDB教程

www. 1 1 1cn.net 編輯:future 來源:轉載
安裝MariaDB數據庫最多用於linux系統中了,下文給各位介紹在Windows服務器Azure雲編譯安裝MariaDB教程,但願本文能幫助到各位。
 
試用 1元Windows Azure,帶寬都是槓槓的。下面演示下Windows Azure下編譯安裝LNMP環境,系統環境是 Ubuntu  14.04 TLS版
軟件版本:
數據庫:mariadb-10.0.13 Stable
PHP:php-5.5.15 Stable
Nginx:nginx/1.4.6 (Ubuntu)(這裏Nginx採用Ubuntu的apt安裝方式)
1.新建MySQL用戶:
考慮到系統安裝,新建的用戶不能登陸(nologin),編輯 vi /etc/shells 添加 「/usr/sbin/nologin」使系統支持建立nologin用戶
useradd -m /app/mysql -s /usr/sbin/nologin -u 555 mysql
2.安裝編譯環境和安裝MariaDB已經PHP依賴包:
apt-get install build-essential
apt-get install libncurses5-dev cmake bison libxml2 libxml2-dev libxslt1-dev libcurl4-openssl-dev libbz2-dev 
libpcre3 libpcre3-dev unzip openssl libssl-dev libpng12-dev libfreetype6-dev libjpeg-dev libmcrypt-dev 
libldap2-dev libsasl2-dev libboost-dev
3.下載並編譯安裝MariaDB、PHP
wget http://cn2.php.net/get/php-5.5. 15.tar.bz2/from/this/mirror
wget http://mirrors.neusoft.edu.cn/mariadb/mariadb- 10.0. 13/source/mariadb- 10.0. 13.tar.gz
1).安裝目錄分別爲:/app/mysql 和 /app/php5
2).cmake . -DCMAKE_INSTALL_PREFIX=/app/mysql/ -DMYSQL_DATADIR=/app/mysql/data/ 
-DSYSCONFDIR=/app/mysql/etc/ -DMYSQL_UNIX_ADDR=/app/mysql/tmp/mysqld.sock -DMYSQL_TCP_PORT=3336 
-DWITH_SSL=system -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_ZLIB=system -DENABLED_LOCAL_INFILE=1 
-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql
3)../configure --prefix=/app/php5 --with-config-file-path=/app/php5/etc/ --with-mysql=mysqlnd 
--with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/app/mysql/tmp/mysqld.sock --with-freetype-dir 
--with-jpeg-dir --with-png-dir --with-zlib --enable-xml --disable-rpath --enable-bcmath --enable-shmop 
--enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt 
--with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap 
--with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --enable-fpm --with-fpm-user=www-data 
--with-fpm-group=www-data --enable-opcache
Ubuntu 14.04 編譯安裝新版本的PHP5.5可能會出現以下錯誤:
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup@@OPENLDAP_2.4_2'
//usr/lib/x86_64-linux-gnu/liblber-2.4.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
遇到這種相似的狀況,說明「./configure 」?]抓好一些環境變數值。解決方法,來自老外的一篇文章:
在PHP源碼目錄下 vi Makefile 找到 EXTRA_LIBS 行,在行末添加 ‘ -llber ‘ 保存退出再次make便可。
到此 Ubuntu編譯安裝MariaDB就完成了,關於Nginx鏈接PHP這裏就很少說了,下面是這次編譯的結果:http://azure0.iloxp.com/tz.php 這只是測試用的,截圖留着哈:
相關文章
相關標籤/搜索